A researcher measured LDL cholesterol in 30 patients before starting a therapeutic diet, then measured the same 30 patients again two months later. When analysing the data, the researcher put all 60 readings in one column, added a categorical variable (before = 1, after = 2), and ran an independent t-test.
The p-value came out at p = 0.28, so the researcher concluded that the diet had no noteworthy effect. When the same data were reanalysed with a paired t-test, the p-value dropped to p < 0.001!
Using a test for independent samples on paired data is not just a cosmetic mistake in the name of the test. It breaks the assumption that observations are independent, inflates the standard error, and hides the real differences that exist in your data.
How to Tell Independent Data From Paired Data
The key question that separates the two types is: is there a systematic link tying each observation in the first group to one specific observation in the second group?
1. Independent Data
There is no connection between the first individual in group (A) and any particular individual in group (B).
- Example: a randomized trial with 50 patients receiving drug (A) and 50 other patients receiving drug (B). Knowing the result for patient number 1 in the first group tells us nothing about patient number 1 in the second group.
2. Paired or Dependent Data
These arise when each reading in the first column is linked to a corresponding reading in the second column. This happens in four common designs:
- Before / after measurement: measuring the same patient’s biomarker before and after an intervention.
- Crossover design: the same patient receives treatment (A) in the first period and treatment (B) in the second period, after a drug washout.
- Split-body or twin studies: comparing the right eye with the left eye of the same patient in eye research, or the two sides of the jaw in dentistry.
- 1:1 matched pairs: pairing each patient with a healthy participant who is closely similar in age, sex, and body mass index, then analysing the matched pairs.
Why the Independent-Samples Test Fails When Applied to Paired Data
When we measure blood pressure or weight in 5 different patients, we find large differences between one patient and another before any treatment starts (for example, one patient weighs 65 kg and another 110 kg). This difference is called between-subject variability.
- The independent-samples test does not know that the first reading in “before” and the first reading in “after” belong to the same person. It folds the huge variability between individuals into the denominator of the formula (the standard error), so the small, consistent change produced by the treatment is lost in the noise of people’s different weights.
- The paired test first calculates the difference for each patient separately (dᵢ = x_(before) - x_(after)). In this way it removes the between-subject variability completely and keeps only the variability of the individual differences.
A Numerical Example With the Full Calculation: See the Difference Yourself
Suppose we measured joint pain (on a numeric scale from 0 to 100) in five patients before and after a physiotherapy session:
| Patient | Before (X₁) | After (X₂) | Individual difference (dᵢ = X₁ - X₂) |
|---|---|---|---|
| Patient 1 | 50 | 44 | +6 |
| Patient 2 | 60 | 52 | +8 |
| Patient 3 | 70 | 64 | +6 |
| Patient 4 | 80 | 70 | +10 |
| Patient 5 | 90 | 80 | +10 |
| Mean | X̄₁ = 70.0 | X̄₂ = 62.0 | d̄ = +8.0 |
Notice that every single patient improved, by 6 to 10 points, without exception! Let us see how the two tests handle these numbers:
First: The Correct Calculation With the Paired t-Test
We work only with the column of five individual differences (dᵢ): 6, 8, 6, 10, 10.
- Mean of the differences (d̄):
d̄ = (6 + 8 + 6 + 10 + 10)/5 = 40/5 = 8.0
Deviations of the differences from their mean (dᵢ - 8): -2, 0, -2, +2, +2.
Sum of squared deviations of the differences:
(-2)² + 0² + (-2)² + (+2)² + (+2)² = 4 + 0 + 4 + 4 + 4 = 16
- Variance of the differences (s_(d)²) and its standard deviation (s_(d)):
s_(d)² = 16/(n - 1) = 16/4 = 4.0 ⇒ s_(d) = √(4.0) = 2.0
- Standard error of the mean difference (SE_(d̄)):
SE_(d̄) = (s_(d))/(√(n)) = 2.0/(√(5)) = 2.0/2.2361 ≈ 0.8944
- Test statistic (t_(paired)) with df = 4:
t = (d̄)/(SE_(d̄)) = 8.0/0.8944 ≈ 8.94
This value (t = 8.94 at df = 4) gives a strongly significant p-value (p < 0.001).
Second: What If We Wrongly Use the Independent t-Test?
If we ignore the pairing and calculate the variance within each column separately:
- In the “before” column (50, 60, 70, 80, 90): the mean is 70 and the sum of squared deviations is (-20)² + (-10)² + 0 + 10² + 20² = 1000, so its variance is s₁² = 1000 / 4 = 250.
- In the “after” column (44, 52, 64, 70, 80): the mean is 62, its deviations from 62 are (-18, -10, +2, +8, +18), and the sum of their squares is 324 + 100 + 4 + 64 + 324 = 816, so its variance is s₂² = 816 / 4 = 204.
- Independent standard error of the difference between the means:
SE_(ind) = √(s₁²/n₁ + s₂²/n₂) = √(250/5 + 204/5) = √(50 + 40.8) = √(90.8) ≈ 9.5289
- The wrong independent t value (df = 8):
t_(ind) = (70.0 - 62.0)/9.5289 = 8.0/9.5289 ≈ 0.84
A t value of 0.84 gives p = 0.425 (not statistically significant at all!).
Compare the two numbers: the standard error in the wrong independent test (9.53) is more than ten times the correct standard error in the paired test (0.89), which knocked the t value down from 8.94 to 0.84.
Which Paired Test to Choose According to Your Variable Type
| Outcome variable type | Two paired measurements (two time points: before / after) | 3 or more paired measurements (multiple time points) |
|---|---|---|
| Continuous, differences normally distributed | Paired t-test | Repeated-measures ANOVA or Linear Mixed Models |
| Continuous non-normal or ordinal | Wilcoxon signed-rank test | Friedman test |
| Binary (yes / no, positive / negative) | McNemar’s test | Cochran’s Q test or Generalized Estimating Equations (GEE) |
An Important Note on Binary Variables: McNemar’s Test
When you measure a binary variable in the same individuals before and after an intervention (for example, smoker / non-smoker before and after an awareness programme), do not use Pearson’s chi-square test of independence, because chi-square assumes the two groups are independent. The correct alternative is McNemar’s test, which focuses on the discordant pairs: how many people were smokers and quit, versus how many were non-smokers and started smoking.
What If You Have 3 or More Time Points With Missing Values?
When patients are measured at (week 0, week 4, and week 12), repeated-measures ANOVA is traditionally used, provided the sphericity assumption holds (checked with Mauchly’s test, with a Greenhouse–Geisser correction when needed). However, this test drops a patient entirely if even one visit is missing. Modern statisticians therefore prefer Linear Mixed-Effects Models (LMM), which use all the visits available for each patient and handle uneven time intervals flexibly.
How to Write It Up in Your Research
In the results section, do not just report the “before” mean and the “after” mean separately. Report the mean difference with its 95% confidence interval:
Sample reporting sentence (APA 7th edition style):
“Pre- and post-intervention pain scores within the same participants were compared using a paired-samples t-test after confirming the normality of paired differences. Mean pain scores decreased from 70.0 ± 15.8 at baseline to 62.0 ± 14.3 post-intervention, representing a statistically significant mean reduction of 8.0 points (95% CI [5.5, 10.5], t(4) = 8.94, p < .001).”
To apply this to your own data, try it on analysez.ai.