A two-sample t-test compares the means of two independent groups to decide whether an observed difference is large enough to be unlikely from random sampling alone. It is used in experiments, surveys, and quality control when the population standard deviations are unknown. The test turns the difference between sample means into a t statistic, which is compared to a t distribution.
This helps students move from visual overlap between groups to a quantitative decision.
Key Facts
- Unpooled two-sample t statistic: t = (xbar1 - xbar2) / sqrt(s1^2/n1 + s2^2/n2)
- Pooled two-sample t statistic: t = (xbar1 - xbar2) / (sp sqrt(1/n1 + 1/n2))
- Pooled variance: sp^2 = ((n1 - 1)s1^2 + (n2 - 1)s2^2) / (n1 + n2 - 2)
- Pooled degrees of freedom: df = n1 + n2 - 2
- Null hypothesis for most two-sample t-tests: H0: μ1 - μ2 = 0
- A 95 percent confidence interval for the difference is (xbar1 - xbar2) ± t* sqrt(s1^2/n1 + s2^2/n2) for the unpooled test
Vocabulary
- Two-sample t-test
- A statistical test that compares the means of two independent groups when population standard deviations are unknown.
- Independent samples
- Samples are independent when the observations in one group do not determine or pair with observations in the other group.
- Pooled variance
- A combined estimate of variance used when two populations are assumed to have equal variances.
- Unpooled test
- A version of the two-sample t-test, often called Welch's t-test, that does not assume equal population variances.
- p-value
- The p-value is the probability of getting a test statistic at least as extreme as the observed one if the null hypothesis is true.
Common Mistakes to Avoid
- Using a two-sample t-test for paired data is wrong because matched before and after measurements are not independent. Use a paired t-test when each value in one group is naturally linked to a value in the other group.
- Choosing the pooled test without checking the equal-variance assumption can give misleading results. If sample standard deviations are very different, use the unpooled Welch test.
- Interpreting a large p-value as proof that the means are equal is wrong. A large p-value means the data do not provide strong evidence of a difference, not that the null hypothesis is certainly true.
- Forgetting that the denominator is a standard error leads to incorrect t statistics. Use sqrt(s1^2/n1 + s2^2/n2), not s1 + s2 or s1^2 + s2^2.
Practice Questions
- 1 Group A has n1 = 16, xbar1 = 52, and s1 = 8. Group B has n2 = 16, xbar2 = 46, and s2 = 6. Assuming equal variances, compute sp, the standard error, and the two-sample t statistic.
- 2 Use the unpooled formula for Group A with n1 = 25, xbar1 = 104, s1 = 10 and Group B with n2 = 20, xbar2 = 96, s2 = 12. Compute the t statistic for testing H0: μ1 - μ2 = 0.
- 3 A study compares test scores from two different classes, while another study compares the same students' scores before and after tutoring. Explain which study should use an independent two-sample t-test and which should use a paired t-test.