Paired t-test
A paired t-test compares two measurements on the same subjects (before and after, left and right). Subtract to get one difference per pair, then run a one-sample t-test on the differences: t = d-bar / (s_d / sqrt(n)), with n - 1 degrees of freedom.
Syntax
t = d-bar / (s_d / sqrt(n)), df = n - 1| Part | What it is |
|---|---|
d-bar | the mean of the pairwise differences |
s_d | the standard deviation of the differences |
n | the number of pairs |
Examples
After - before for 5 people: 2, 3, 1, 4, 5
d-bar = 3; s_d = sqrt(10 / 4) = 1.581
SE = 1.581 / sqrt(5) = 0.707; t = 3 / 0.707Result: t = 4.24, df = 4, two-sided p = 0.013
Excel from the two columns
=T.TEST(B1:B5, A1:A5, 2, 1)Result: 0.013 (type 1 = paired, tails 2)
95% CI for the mean difference
3 +/- 2.776 * 0.707Result: 1.04 to 4.96
Common mistakes
- Running an independent two-sample test on paired data; it ignores the pairing and usually loses power.
- Mixing the order of subtraction between pairs; use after minus before for every pair so the sign is consistent.
- Dropping pairs with a missing value in only one column silently; T.TEST needs equal-length ranges, so remove the incomplete pair from both.
Practice Paired t-test
These drills check your answer on live data, free, no account needed.
- Paired t test6 employees took a skills test before and after a training course (same people, so the scores are paired). Before: 90, 78, 71, 66, 69, 59. After: 87, 77, 65, 58, 69, 56. Find the paired t statistic for the mean change (after minus before), then test H0: μd = 0 against H1: μd ≠ 0 at α = 0.05. Round to 2 decimal places.
Questions
When should I use a paired t-test?
When each observation in one group has a natural partner in the other: the same person measured twice, twins, matched products tested side by side.
What is the null hypothesis of a paired t-test?
That the mean difference is zero, that is, no change between the two conditions.
What if the differences are not normal?
With about 30 or more pairs the t-test is still fine. For small, skewed samples use the Wilcoxon signed-rank test.
Related
- One-sample t-testHow to run a one-sample t-test: compute t = (x-bar - mu0) / (s / sqrt(n)), find the p-value with n - 1 degrees of freedom and decide. Example and Excel.
- Two-sample t-testHow to compare two independent means with a two-sample t-test: the Welch formula, degrees of freedom, a worked example and the Excel T.TEST function.
- p-valueA p-value is the probability of a result at least as extreme as the observed one if the null is true. How to compute it from z and t, and common misreadings.
- Confidence interval for a meanHow to calculate a confidence interval for a mean with x-bar plus or minus t times s over root n, a full 95% example, when to use z, and Excel CONFIDENCE.T.