The t-test is a small-sample test (population SD unknown) that checks whether a mean, or the difference between two means, is statistically significant using the t-distribution. The paired t-test is used when the two sets of observations come from the same subjects; the unpaired (independent) t-test is used when they come from two different, independent groups.
General form: \(t = \dfrac{\text{difference observed}}{\text{standard error of the difference}}\), compared with the table value of t at the chosen significance level and degrees of freedom.
Paired t-test (dependent samples)
\[t = \frac{\bar d}{s_d/\sqrt n},\quad df = n-1\]
where \(d\) is the difference in each pair and \(s_d\) is the SD of these differences. Use it when:
- the same students are tested before and after coaching;
- blood pressure of the same patients is measured before and after a drug;
- two methods/instruments are applied to the same items;
- subjects are matched in pairs (twins, same-age pairs).
Unpaired (independent two-sample) t-test
\[t = \frac{\bar x_1 - \bar x_2}{s_p\sqrt{\frac1{n_1}+\frac1{n_2}}}\]
\[s_p^2 = \frac{(n_1-1)s_1^2 + (n_2-1)s_2^2}{n_1+n_2-2}\]
with \(df = n_1 + n_2 - 2\). Use it when:
- comparing mean marks of two different divisions;
- comparing a drug group with a separate placebo group;
- comparing yields from two varieties grown on different plots;
- sample sizes may be unequal. (If variances are clearly unequal, Welch's t-test is used.)
Key difference: the paired test removes variation between subjects by working with differences, so it is more powerful when pairing is natural; using an unpaired test on paired data (or vice versa) gives wrong results.