Use sample variance and the appropriate t degrees of freedom. Estimate a common variance and compare two independent means. Reduce a paired design to a one-sample analysis of differences.
Notes and key methods
For independent observations from a normal population of unknown variance, \(\displaystyle t= \frac{\bar{x}- \mu_{0}}{\frac{s}{\sqrt{n}}}\) has n−1 degrees of freedom under \(\displaystyle H_{0}\). The sample variance \(\displaystyle s^{2}\) uses denominator n−1.
A confidence interval uses \(\displaystyle \bar{x}\pm \frac{t_{n- 1, 1- \frac{\alpha }{2}}s}{\sqrt{n}}\). The t distribution allows uncertainty from estimating σ; replacing its quantile by z can give an interval that is too narrow for a small sample.
For independent normal samples with equal unknown population variances, pool the unbiased sample variances: \(\displaystyle s_{p}^{2}= \frac{[(n_{1}- 1)s_{1}^{2}+ (n_{2}- 1)s_{2}^{2}]}{n_{1}+ n_{2}- 2}\).
The standard error of the mean difference is \(\displaystyle s_{p}\sqrt{\frac{1}{n_{1}}+ \frac{1}{n_{2}}}\), and the pooled t statistic uses \(\displaystyle n_{1}+n_{2}-2\) degrees of freedom. A confidence interval for the difference uses the same standard error.
For matched observations form differences in a stated order, such as after minus before. Apply a one-sample t procedure to the differences: \(\displaystyle t= \frac{\bar{d}- \delta_{0}}{\frac{s_{d}}{\sqrt{n}}}\), with n−1 degrees of freedom.
The pairs must be independent of one another; the two observations within a pair need not be independent. The normality assumption concerns the population of differences, rather than the separate before/after measurements.
Check the conditions
A normal population is assumed for exact small-sample t inference.
The observations are a random independent sample.
Samples are independent and normally distributed.
Equal unknown population variances are assumed for this pooled procedure.
The pairing is meaningful and fixed before analysis.
For an exact small-sample t-test, differences are normally distributed.
Three worked examples
Example 1 · One-sample t inference
A random sample of 9 independent normal observations has mean 25.5 and unbiased sample standard deviation 5. Test \(H_0:\mu=23\) against an increase; the population variance is unknown.
Use a 5% significance level for a written conclusion. A distribution calculator may be used for numerical p-values.
Find the observed t statistic.
Find the degrees of freedom.
Find the one-sided p-value.
Find the half-width of a two-sided 95% t confidence interval.
The p-value is \(0.0860016459759556\). Since it exceeds 0.05, do not reject \(\displaystyle H_{0}\): the sample gives insufficient evidence that the population mean exceeds its null value. This does not give the probability that \(\displaystyle H_{0}\) is true.
Example 2 · Two-sample pooled t inference
Two independent normal populations have a common unknown variance. Sample sizes are 7 and 12, their unbiased variances are 4 and 6, and \(\displaystyle \bar x_1-\bar x_2=\frac{7}{2}\).
Use \(\displaystyle H_{1}: \mu _{1}>\mu _{2}\) and a 5% significance level for the written test conclusion.
Find the pooled variance estimate.
Find the standard error of the mean difference.
Find the t statistic for equal population means.
Find the half-width of a two-sided 95% confidence interval for the mean difference.
With 17 degrees of freedom the upper-tail p-value is \(0.00263277157273379\). Reject \(\displaystyle H_{0}\): the first mean is greater.
Example 3 · Paired t-tests
For six independent matched pairs, after-minus-before differences are \(2,8,11,17,20,26\). Assume that population differences are normal. Test a positive mean difference.
Use a 5% significance level for a written conclusion. A distribution calculator may be used for numerical p-values.
Find the mean difference.
Find the unbiased variance of the differences.
Find the t statistic for null mean difference zero.
The p-value is \(0.0054577501915573\). Since it is at most 0.05, reject \(\displaystyle H_{0}\): there is evidence that the mean paired difference is positive. This does not give the probability that \(\displaystyle H_{0}\) is true.
Common mistakes
Use n−1 degrees of freedom, not n.
Keep the one-sided test tail distinct from a two-sided interval.
Do not pool means instead of within-sample variances.
The variance of a difference adds the independent sampling variances.
Do not use the two-sample standard error for paired observations.
Reversing the subtraction order reverses both the sign and the relevant alternative.