Statistics 🔬 Confidence & Inference

Paired Data vs Two Independent Samples

The same design question the course keeps asking — are these two sets of numbers linked, or independent? — decides which t-procedure applies.

Intro StatisticsCollege intro statistics level
Paired Data vs Two Independent Samples — illustration
Illustrative image (AI-generated).
💡
The big idea: You already met the two-sample Welch t-test for comparing two independent groups. But many datasets aren't independent — the same subjects are measured twice, or subjects are deliberately matched into similar pairs. Running the wrong procedure on linked data gets both the standard error and the degrees of freedom wrong, and throws away exactly the information pairing was designed to capture. This lesson gives you the paired t procedure, the decision rule for choosing between the two designs, and the matching confidence interval.
🎯 By the end, you'll be able to
  • Recognize when data are paired (before/after, matched pairs, twins, the same subject measured twice) versus two independent samples
  • Compute a paired t statistic by running a one-sample t test on the within-pair differences
  • State the degrees of freedom for a paired t test (n − 1, where n is the number of pairs) and contrast it with the Welch two-sample degrees of freedom
  • Check the normality condition for a paired t test, and know when to prefer Welch's unpooled t for two independent samples
  • Build a confidence interval for a paired mean difference
📎 You should already know
  • t-Tests and Comparing Means
  • Designing Experiments (matched-pairs design)
  • Confidence Intervals

Recap, and a new question

The previous lesson gave you the two-sample Welch t-test for comparing the means of two independent groups — two separate samples with no link between an observation in one and an observation in the other.

But plenty of real data are not independent. A weight-loss program measures the same person before and after. A taste test asks the same taster to rate two recipes. A study matches each smoker to a similar non-smoker of the same age and sex. In every one of these, an observation in one group is deliberately tied to a specific observation in the other. That link changes which procedure is correct.

🔑 The decision rule

Ask one question before you touch a formula: was each observation in one group deliberately linked to one specific observation in the other?

  • Yes (before/after on the same subject, matched pairs, twins, the same item measured twice) — use the paired t test.
  • No (two separate, independently chosen groups) — use the two-sample Welch t test from the previous lesson.
⚠️ The most common mistake: the wrong test on a paired design

WRONG: Analyzing paired data — before/after measurements, matched pairs, twins, the same subject measured twice — with the two-sample t-test.

RIGHT: When each observation in one group is deliberately linked to one in the other, you must use the paired t on the differences. A two-sample test applied to paired data uses the wrong standard error and the wrong degrees of freedom, and it throws away the within-pair correlation that pairing was designed to exploit — usually losing power you already paid for by pairing.

The paired t procedure: collapse two measurements into one

Pairing lets you sidestep subject-to-subject variability entirely. For each pair \( i \), compute the difference \( d_i = x_i - y_i \). Now you have a single sample of \( n \) differences — one per pair — and you run an ordinary one-sample t-test on that sample, exactly like the one-sample procedure from the previous lesson, just applied to the \( d_i \)'s instead of raw measurements.

This is the same matched-pairs idea from Designing Experiments: each subject serves as their own control, or two similar subjects are matched and treatments assigned within the pair. The design decision made back then is what makes this analysis valid now.

\[ t = \frac{\bar{d} - \mu_0}{s_d / \sqrt{n}}, \qquad \text{df} = n - 1 \]
The paired t statistic: the mean difference d-bar, standardized by its own standard error, compared against a t-distribution with n − 1 degrees of freedom, where n is the number of pairs, not the number of raw measurements.
⚠️ Two quick corrections: degrees of freedom, and what has to be normal

WRONG: 'Paired t has \( n_1 + n_2 - 2 \) degrees of freedom.'
RIGHT: Paired t works on the \( n \) differences: \( \text{df} = n - 1 \), where \( n \) is the number of pairs. There is only one sample here — of differences — not two.

WRONG: 'The t procedure requires the sample to be normal.'
RIGHT: The condition is that the population — for a paired t, the population of differences — is approximately normal, or that \( n \) is large enough for the central limit theorem to apply. You inspect your sample of differences for gross skew or outliers as evidence about that population, but the assumption itself is about the population, not the sample.

\[ t = \frac{(\bar{x}_1 - \bar{x}_2) - \Delta_0}{\sqrt{\dfrac{s_1^2}{n_1} + \dfrac{s_2^2}{n_2}}} \]
The two-sample Welch t statistic you met in the previous lesson, t-Tests and Comparing Means — shown here only for contrast, not re-derived. Its degrees of freedom are worked out by software (the Welch-Satterthwaite approximation) and fall somewhere between min(n1, n2) − 1 and n1 + n2 − 2.
⚠️ Don't default to pooling

When two-group data really are two independent groups, not pairs, one more habit needs correcting.

WRONG: 'Always pool the two-sample variance.'
RIGHT: Prefer Welch's (unpooled) t: it does not assume the two groups have equal variances, and it is valid even when they differ — while giving nearly the same answer as the pooled t when the variances happen to be equal. The pooled t requires an equal-variance assumption that is rarely safe to make, so Welch is the house default.

A confidence interval for the paired difference

Just as a one-sample t statistic has a matching confidence interval, so does the paired t. Instead of testing whether the mean difference equals a hypothesized value, you can report a range of plausible values for the true mean difference \( \mu_d \) directly:

\[ \bar{d} \pm t^{*}_{n-1}\,\frac{s_d}{\sqrt{n}} \]
A confidence interval for the mean paired difference: the sample mean difference d-bar, plus or minus the critical value t-star (from the t-distribution with n − 1 degrees of freedom) times the standard error of the differences.
📝 Worked example: A running coach records resting heart rate (beats per minute) for 6 runners before and after a 6-week training block. Because the same runners are measured twice, this is paired data. Test whether the mean resting heart rate decreased, and give a 95% confidence interval for the mean decrease.
  1. Data (before, after, difference d = before minus after) for the 6 runners: (82, 76, 6), (78, 75, 3), (90, 82, 8), (85, 79, 6), (76, 74, 2), (88, 83, 5).
  2. Mean difference: \( \bar{d} = (6+3+8+6+2+5)/6 = 30/6 = 5.0 \) bpm.
  3. Deviations of the differences from 5 are 1, −2, 3, 1, −3, 0; squared they are 1, 4, 9, 1, 9, 0, summing to 24. Sample standard deviation: \( s_d = \sqrt{24/5} = \sqrt{4.8} \approx 2.191 \) bpm.
  4. Standard error: \( s_d/\sqrt{n} = 2.191/\sqrt{6} \approx 2.191/2.449 \approx 0.894 \) bpm.
  5. Test statistic: \( t = \bar{d}/(s_d/\sqrt{n}) = 5.0/0.894 \approx 5.59 \), with \( \text{df} = n - 1 = 5 \).
  6. For a one-sided test at \( \alpha = 0.05 \) with df = 5, the critical value is about 2.015; our t = 5.59 is far beyond it, so the p-value is well under 0.05.
  7. 95% confidence interval for the mean difference, using \( t^{*}_{5} \approx 2.571 \): \( 5.0 \pm 2.571 \times 0.894 \approx 5.0 \pm 2.30 \), i.e., about (2.70, 7.30) bpm.
✓ The mean resting heart rate dropped by about 5.0 bpm after training (t ≈ 5.59, df = 5), far more than chance alone would produce at this sample size, so we reject H0: mu_d = 0 in favor of a real decrease. A 95% confidence interval for the true mean decrease is about (2.70, 7.30) bpm. Because these runners were not randomly assigned to a 'train' versus 'no train' condition — they simply all trained — this shows an association within the runners studied, not automatically a proven causal effect (see the scope-of-inference rule in Designing Experiments for when a causal claim is licensed).
⚠️ Two universal corrections, worth repeating here

WRONG: 'Since p > α we accept H0.'
RIGHT: We fail to reject H0 — insufficient evidence against it, not proof that it is true.

WRONG: 'The significant difference proves the treatment worked.'
RIGHT: A causal reading requires random assignment (see the scope-of-inference rule in Designing Experiments). A paired before/after study with no randomized control group shows an association within the subjects studied, not an airtight causal proof.

Check your understanding

1. A study measures each employee's typing speed before and after a training course. Which test should you use to compare the means?
The 'after' measurement for each employee is deliberately linked to that same employee's 'before' measurement, so the data are paired. Use the paired t on the within-employee differences, not a two-sample test.
2. A paired t-test is run on 9 pairs of measurements. What are the degrees of freedom?
Paired t runs on the n differences, one per pair: df = n − 1 = 9 − 1 = 8. There is no n1 + n2 − 2 here, because there is only one sample — of differences.
3. Two independent samples have noticeably different sample variances. Which is the safer default two-sample t-procedure?
When variances plausibly differ, Welch's unpooled t is the safer default: it doesn't require equal variances and is nearly identical to the pooled t when the variances happen to be equal.
4. For a paired t-test, the normality condition applies to…
The normality condition for a paired t is about the population of within-pair differences (or the CLT kicking in for large n) — not about the two raw samples separately.
✅ Key takeaways
  • Two-group data are either linked (paired) or independent — decide this before choosing a test: a deliberate link between one observation and a specific observation in the other group means paired t; no link means two-sample Welch t.
  • Paired t collapses two measurements into one: compute the differences d_i, then run a one-sample t on them, with df = n − 1 where n is the number of pairs.
  • Applying a two-sample test to paired data gets the standard error and degrees of freedom wrong and throws away the within-pair correlation that pairing was designed to exploit.
  • The two-sample Welch t (the house default, unpooled) remains the right tool for genuinely independent groups; its degrees of freedom are computed by software, between min(n1, n2) − 1 and n1 + n2 − 2.
  • The normality condition is about the population — of differences, for a paired t — not the sample; you check the sample only for gross skew or outliers as evidence.
  • A confidence interval for a paired mean difference is d-bar plus-or-minus t-star times s_d over root n; a significant result still needs random assignment before it supports a causal claim.