01 / 21

The Paired
\(t\)-Test

Learn how to compare two related measurements from the same subjects using the paired \(t\)-test: the go-to method for matched data.

Biostatistics

What Is Paired Data?

Paired data arises when each observation in one group has a natural partner in the other group. The two measurements are linked because they come from the same subject or a deliberately matched pair.

Before / After
Blood pressure measured on the same patient before and after a drug
Left / Right
Grip strength of the left hand vs. right hand of the same person
Twin Studies
Cholesterol level in twin A (treatment) vs. twin B (control)

Why Pairing Matters

Each person has their own baseline: some people naturally have high blood pressure, others low. By computing differences within each pair, we remove that between-subject variability and isolate the treatment effect.

Unpaired View Group Before After Value Paired View Group Before After Value

The Key Idea: Reduce to One Sample

For each pair \(i\), compute the difference:

Now we have a single sample of differences \(d_1, d_2, \ldots, d_n\). The paired \(t\)-test is simply a one-sample \(t\)-test on these differences, testing whether the mean difference \(\mu_d\) equals zero.

Setting Up the Hypotheses

Null Hypothesis
\(H_0 : \mu_d = 0\)
The mean difference is zero: no effect.
Alternative (two-sided)
\(H_a : \mu_d \neq 0\)
The mean difference is not zero.

The Paired \(t\) Statistic

\(\bar{d}\)
Mean of the differences
\(s_d\)
Standard deviation of the differences
\(n\)
Number of pairs (not total observations)

Visualizing the \(t\)-Distribution

0 -t* +t* Reject Reject t-value Fail to reject H₀

Assumptions of the Paired \(t\)-Test

1
Paired observations: Each data point in one condition has a unique matched partner in the other condition.
2
Continuous differences: The differences \(d_i\) should be measured on an interval or ratio scale.
3
Normality of differences: The \(d_i\) should be approximately normally distributed (check with a histogram or Shapiro-Wilk test). Robust when \(n \ge 30\) by the CLT.
4
No extreme outliers: Outliers in the differences can heavily distort \(\bar{d}\) and \(s_d\).

Paired vs. Independent \(t\)-Test

Paired \(t\)-Test Independent \(t\)-Test
Design Same subjects, two conditions Two separate groups
Data used Differences \(d_i\) Raw scores in each group
Degrees of freedom \(n - 1\) Approx. \(n_1 + n_2 - 2\)
Controls for Subject variability Nothing (assumes equal var.)
Power Often higher (less noise) Lower if subjects vary a lot

How to Apply the Paired \(t\)-Test

1
Compute differences: For each pair, calculate \(d_i = X_{i,\text{after}} - X_{i,\text{before}}\).
2
Find \(\bar{d}\): Calculate the mean of the differences.
3
Find \(s_d\): Calculate the standard deviation of the differences.
4
Compute \(t\): Use \( t = \frac{\bar{d}}{s_d / \sqrt{n}} \).
5
Find \(p\)-value: Compare \(t\) to the \(t\)-distribution with \(n-1\) degrees of freedom.
6
Decide: If \(p < \alpha\), reject \(H_0\) and conclude the mean difference is significant.

Example 1: Blood Pressure Study

Five patients had their systolic blood pressure measured before and after a new medication. Test at \(\alpha = 0.05\) whether the drug significantly reduces blood pressure.

Patient Before After \(d_i\)
1142138-4
2150140-10
3135132-3
4148143-5
5160152-8

Example 1: Calculation

1
Mean of differences: \(\bar{d} = \frac{-4 + (-10) + (-3) + (-5) + (-8)}{5} = \frac{-30}{5} = -6.0\)
2
Std dev of differences: \(s_d = \sqrt{\frac{\sum(d_i - \bar{d})^2}{n-1}} = \sqrt{\frac{4+16+9+1+4}{4}} = \sqrt{8.5} \approx 2.915\)
3
Test statistic: \(t = \frac{-6.0}{2.915 / \sqrt{5}} = \frac{-6.0}{1.304} \approx -4.60\)
4
Decision: With \(\text{df} = 4\), the one-tailed critical value at \(\alpha = 0.05\) is \(-2.132\). Since \(-4.60 < -2.132\), we reject \(H_0\).

Example 2: Reaction Time Study

Eight athletes had their reaction time (ms) measured before and after a caffeine supplement. Test at \(\alpha = 0.05\) (two-sided) whether caffeine changes reaction time.

Athlete Before After \(d_i\)
1230215-15
2245238-7
3220210-10
4260250-10
5235228-7
6250245-5
7215218+3
8240230-10

Example 2: Solution

1
Differences: \(-15, -7, -10, -10, -7, -5, +3, -10\)
2
Mean: \(\bar{d} = \frac{-61}{8} = -7.625\)
3
Std dev: \(s_d \approx 5.236\)
4
Test statistic: \(t = \frac{-7.625}{5.236 / \sqrt{8}} = \frac{-7.625}{1.851} \approx -4.12\)
5
Decision: \(\text{df} = 7\), two-tailed critical value \(\pm 2.365\). Since \(|-4.12| > 2.365\), we reject \(H_0\).

Confidence Interval for \(\mu_d\)

Beyond hypothesis testing, we can estimate how large the true mean difference is:

Using Example 1: \(\bar{d} = -6.0\), \(s_d = 2.915\), \(n = 5\), and \(t^*_{0.025,4} = 2.776\):

Common Mistakes

✕ Using an independent test on paired data
Ignoring the pairing structure throws away information and reduces power. Always check if data are naturally paired.
✕ Wrong \(n\): counting individuals, not pairs
If 10 patients are measured twice, \(n = 10\) pairs, not 20 observations. The degrees of freedom are \(\text{df} = n - 1 = 9\).
✕ Ignoring the normality check
With small \(n\), skewed differences or heavy outliers can invalidate the \(t\)-test. Plot the differences or use Shapiro-Wilk first.

Question 1 of 5

In a paired \(t\)-test with 12 pairs, how many degrees of freedom does the test have?

Question 2 of 5

Given \(\bar{d} = 3.2\), \(s_d = 4.0\), and \(n = 16\) pairs, what is the paired \(t\) statistic?

Question 3 of 5

A researcher measures the weight of 20 participants before and after a diet program. Which test is most appropriate?

Question 4 of 5

The 95% confidence interval for \(\mu_d\) is \((-1.5, \; 4.3)\). What can you conclude at \(\alpha = 0.05\)?

Question 5 of 5

Which assumption is most critical for the paired \(t\)-test when the sample size is small (e.g., \(n = 8\))?