Functions > Statistics > Probability Distributions > Example: T-Test on Normal Means
Example: T-Test on Normal Means
Test the hypothesis that two normal populations have equal means.
1. Define data sets to compare.
2. Collect the sample statistics.
 Number of samples for each data set n1 length data1 n2 length data2 n1 n2 Sample means m1 mean data1 m2 mean data2 m1 m2 Sample standard deviations s1 stdev data1
n1 n1 1
s2 stdev data2
n2 n2 1
s1 s2 Degrees of freedom when combining the two means ν n1 n2 2 ν Standard error of the difference in the data sets s
n1 1 s1 2 n2 1 s2 2 ν
1 n1
1 n2
s
3. Define the significance level.
4. Calculate the test statistic.
5. State the null and the alternative hypothesis.
H0: m1 m2
H1: m1 > m2
6. Calculate the p-value and test the hypothesis. In this example, all of the Boolean expressions evaluate to 1 when the null hypothesis is true (you do not reject H0).
There is a 0.946 probability that the test statistic is greater than the one observed, assuming that the null hypothesis is true. The comparison between the p-value and the significance level indicates there is no evidence that the alternative hypothesis is true.
7. Calculate the limit of the critical region and test the hypothesis.
Accept the null hypothesis. There is no evidence that the m1 is greater than m2.
8. Plot the student distribution (blue), the boundary of the critical region (green), and the test statistics (red).