Mathwords logoMathwords

Paired t-Test — Definition, Formula & Example

The paired t-test is a hypothesis test for data that come in matched pairs, such as before-and-after measurements on the same people. You subtract within each pair and then test whether the average difference is zero.

Let (xi,yi)(x_i, y_i) for i=1,…,ni = 1, \dots, n be paired observations with differences di=xi−yid_i = x_i - y_i. Assume the differences are independent draws from an approximately normal population with mean μd\mu_d. The paired t-test tests H0:μd=μ0H_0: \mu_d = \mu_0 (usually μ0=0\mu_0 = 0) with the statistic t=(dˉ−μ0)/(sd/n)t = (\bar{d} - \mu_0)/(s_d/\sqrt{n}). Under H0H_0, this statistic follows a t-distribution with n−1n - 1 degrees of freedom, exactly when the differences are normal and approximately otherwise.

Key Formula

t=dˉ−μ0sd/n,df=n−1t = \frac{\bar{d} - \mu_0}{s_d / \sqrt{n}}, \qquad df = n - 1
Where:
  • dˉ\bar{d} = mean of the paired differences
  • μ0\mu_0 = hypothesized mean difference, usually 0
  • sds_d = sample standard deviation of the differences
  • nn = number of pairs (not the total number of measurements)
  • dfdf = degrees of freedom for the t-distribution

Worked Example

Problem: Five people follow a 6-week fitness program. Their weights in pounds before and after the program are: Person A 180 and 178, B 165 and 161, C 200 and 197, D 150 and 145, E 172 and 171. At the 0.05 significance level (two-tailed), is there evidence that mean weight changed?
Step 1: Use the hypotheses H0:μd=0H_0: \mu_d = 0 and Ha:μd≠0H_a: \mu_d \neq 0. For each person, compute the difference d=before−afterd = \text{before} - \text{after}. Then find the mean difference.
di=2, 4, 3, 5, 1dˉ=2+4+3+5+15=155=3d_i = 2,\ 4,\ 3,\ 5,\ 1 \qquad \bar{d} = \frac{2+4+3+5+1}{5} = \frac{15}{5} = 3
Step 2: Find the standard deviation of the differences. The deviations from 3 are −1, 1, 0, 2, and −2.
sd=(−1)2+12+02+22+(−2)25−1=104=2.5≈1.581s_d = \sqrt{\frac{(-1)^2+1^2+0^2+2^2+(-2)^2}{5-1}} = \sqrt{\frac{10}{4}} = \sqrt{2.5} \approx 1.581
Step 3: Compute the t-statistic with μ0=0\mu_0 = 0 and n=5n = 5 pairs.
t=3−02.5/5=30.5≈30.7071≈4.243t = \frac{3 - 0}{\sqrt{2.5}/\sqrt{5}} = \frac{3}{\sqrt{0.5}} \approx \frac{3}{0.7071} \approx 4.243
Step 4: Compare the statistic to the critical value. With 4 degrees of freedom, the two-tailed critical value at the 0.05 level is about 2.776. Since 4.243 > 2.776, you reject H0H_0.
df=5−1=4,tcrit≈±2.776df = 5 - 1 = 4, \quad t_{\text{crit}} \approx \pm 2.776
Answer: Reject the null hypothesis. With t ≈ 4.243 and 4 degrees of freedom, there is significant evidence at the 0.05 level that mean weight changed. On average, participants lost 3 pounds.

Why It Matters

Matched-pairs designs are a core topic in AP Statistics. They are also standard in medical research, where each patient is measured before and after a treatment. Pairing removes person-to-person variation, so a small but consistent effect can be detected with only a few subjects.

Common Mistakes

Mistake: Analyzing before-and-after data as two independent samples with a two-sample t-test.
Correction: The two columns describe the same people, so they are not independent. In the example, body weights range from 145 to 200 pounds, and that spread would hide the steady 3-pound change. Always subtract within each pair first, then run a one-sample test on the differences using n−1n - 1 degrees of freedom, where nn is the number of pairs.

Related Terms