13. Inference for Paired Means

a. Hypothesis Test
Math 115

Yurk

Where We’ve Been — and Where We’re Going

Three topics, all inference for means:

Topic Inference for Statistic Example
11 One mean \bar{x} Cherry Blossom — mean finish time
12 Two independent means \bar{x}_1 - \bar{x}_2 Birth weights — by smoking habit
13 (today) Paired means \bar{x}_d Textbook prices — UCLA vs Amazon

The trick: compute one difference per pair, then run one-mean inference (topic 11) on the differences. No new formulas.

Paired Data: Reduce to a Single Sample

Paired data = two measurements on the same unit (or a matched pair).

Subject Measurement 1 Measurement 2 Difference
1 x_{1,1} x_{1,2} d_1 = x_{1,2} - x_{1,1}
2 x_{2,1} x_{2,2} d_2 = x_{2,2} - x_{2,1}
… … … …
n x_{n,1} x_{n,2} d_n

Treat the differences d_1, \ldots, d_n as a single sample and run one-mean inference on them.

Common paired designs: before/after on the same subject, same item measured two ways (two stores, two methods), matched pairs (twins, siblings, or two similar people paired up).

Why Pair?

Pairing controls for between-subject variability.

  • Each subject (or unit) serves as its own control
  • Subject-to-subject differences cancel out within each pair
  • The remaining variability is just within-subject — usually much smaller

Example: want to know if a tutoring program raises test scores.

  • Independent design: compare tutored vs. untutored students — most of the variance is just who the students are.
  • Paired design: measure each student before and after — the “before” score absorbs the student-level variability, and the change is what’s left.

Paired designs are usually more efficient — smaller SE, more power for the same number of measurements.

Textbook Prices: UCLA vs Amazon

Do textbook prices differ between the UCLA bookstore and Amazon? Sample of 68 textbooks from UCLA courses, each priced at both stores (Fall 2018).

  • Paired: same book, two prices. The book is its own control — an expensive book is expensive at both stores, so pairing cancels that book-to-book price level and leaves just the UCLA-vs-Amazon gap.
  • Variable of interest: d = UCLA price − Amazon price (per book)
  • Statistic: \bar{x}_d — sample mean of the differences
  • Parameter: \mu_d — population mean difference (UCLA − Amazon)

Hypotheses (two-sided).

  • H_0: \mu_d = 0 (no difference in average price)
  • H_A: \mu_d \neq 0 (prices differ on average)

One Difference per Book

The abstract table from earlier, now made concrete — each book is one row, priced at two stores (in dollars), collapsed to a single difference d = UCLA − Amazon:

Book UCLA ($) Amazon ($) d = UCLA − Amazon
Book 1 47.97 47.45 +0.52
Book 2 14.26 13.55 +0.71
Book 3 13.50 12.53 +0.97
Book 4 49.26 54.95 -5.69
⋮ ⋮ ⋮ ⋮
Book 68 35.96 32.40 +3.56

The 68 differences are now a single sample d_1, \ldots, d_{68} — ready for one-mean inference, exactly as in topic 11.

EDA: Price Differences

n \bar{x}_d ($) s_d ($) min max
68 3.58 13.42 -12.19 75.2

Observed: UCLA prices average about $3.58 higher per book, but the distribution is right-skewed with a few large outliers. Real shift, or sampling noise?

Technical Conditions: Paired Means

The differences d_1, \ldots, d_n play the role of a single sample, so we use the one-mean conditions on the differences:

Condition Rule
Independence Pairs independent of each other — typically from random samples or random assignment, otherwise justified from study context
Normality n \geq 30 → CLT applies to mean of differences. n < 30 → differences should look roughly normal.

Try it: do both conditions hold for the Textbook Prices sample?

Independence: different books from different courses → one book’s price gap shouldn’t affect another’s ✓. Normality: n = 68 \geq 30 ✓, but the differences are right-skewed with a few large outliers — proceed with caution ⚠.

Test Statistic for Paired Means

The T-statistic for paired data is the one-mean T applied to the differences:

T = \frac{\bar{x}_d - 0}{s_d / \sqrt{n}}

  • \bar{x}_d = observed mean of differences
  • 0 = null value (from H_0: \mu_d = 0)
  • s_d / \sqrt{n} = standard error of the mean difference
  • Compare to a t-distribution with df = n - 1 (one pair = one observation)

Identical to topic 11, with \bar{x} \to \bar{x}_d and s \to s_d. The “trick” of reducing pairs to differences buys you the full one-mean toolkit.

Paired or Unpaired?

For each scenario, decide whether the design is paired or unpaired (two independent groups), and name the statistic you’d use.

  1. 50 plots are split into two groups; one group gets fertilizer A, the other gets fertilizer B. Do the mean yields differ? Unpaired — each plot gets only one fertilizer. Statistic: \bar{x}_1 - \bar{x}_2 (topic 12).

  2. Blood pressure is measured before and after a new drug on each of 25 patients. Did the drug change mean blood pressure? Paired — two measurements on the same patient. Statistic: \bar{x}_d, the mean of the before-and-after differences (today).

  3. 18 pairs of twins where one twin smokes and the other does not. Does smoking change mean lung capacity? Paired — the twins are matched, so each pair gives one difference. Statistic: \bar{x}_d (today). Pairing isn’t only before/after — matched pairs count too.

Putting It Together for Textbooks

Hypotheses (two-sided): H_0: \mu_d = 0 vs H_A: \mu_d \neq 0

Sample

  • n = 68 paired textbooks
  • \bar{x}_d = 3.58 dollars
  • s_d = 13.42 dollars

Conditions met with caution (n = 68 \geq 30; right skew + outliers — keep the conclusion tentative).

Coming up: compute SE → T → p-value → conclude.

Computing T for Textbooks

Standard error: \dfrac{s_d}{\sqrt{n}} = \dfrac{13.42}{\sqrt{68}} \approx 1.63 dollars

Try it: plug into T = \bar{x}_d / SE with \bar{x}_d = 3.58, SE \approx 1.63.

T = \dfrac{3.58}{1.63} \approx 2.2 — the mean difference sits about 2.2 SEs above zero.

Calculating the P-value

Two-sided p-value = 2 × (smaller-tail area) ≈ 0.031.

Conclusion for Textbook Prices

Results: T \approx 2.2 (df = 67), p-value \approx 0.031 — just below 0.05 → reject H_0.

Conclusion: Evidence that the UCLA bookstore and Amazon differ in mean price for new textbooks, with UCLA averaging about $3.58 higher in the sample.

Tentative because: the differences are right-skewed with a few large outliers; the p-value is borderline.

Scope: the source describes these as a sample of UCLA courses, not a documented random sample — so we can’t safely generalize beyond textbooks like those sampled (UCLA courses, Fall 2018). A paired comparison of two pricing sources for the same books — not a randomized experiment.

Sleep & Soporific Drugs — Setup

Do two soporific drugs produce different amounts of extra sleep? Each of 10 patients tried both drugs. For each drug we record the patient’s extra hours of sleep vs. no drug (rows 1–2). Our paired variable is d — the within-patient difference between the two drugs (row 3).

Patient 1 2 3 4 5 6 7 8 9 10
Drug 1 0.7 -1.6 -0.2 -1.2 -0.1 3.4 3.7 0.8 0.0 2.0
Drug 2 1.9 0.8 1.1 0.1 -0.1 4.4 5.5 1.6 4.6 3.4
d = Drug 2 − Drug 1 1.2 2.4 1.3 1.3 0.0 1.0 1.8 0.8 4.6 1.4

Summary of differences: n = 10, \bar{x}_d = 1.58 hours, s_d = 1.23 hours. The positive \bar{x}_d means Drug 2 averaged more extra sleep than Drug 1 in this sample. Data: Cushny & Peebles (1905); used as the worked example in Student (1908), the paper that introduced the t-test.

  1. State H_0 and H_A for \mu_d = true mean difference (Drug 2 − Drug 1), two-sided. H_0: \mu_d = 0 (the two drugs give the same mean extra sleep)    H_A: \mu_d \neq 0 (they differ).

Sleep — Conditions

Recall: n = 10, \bar{x}_d = 1.58, s_d = 1.23. With n < 30, the differences should look roughly normal.

  1. Check independence and normality for the differences. Independence: the patients are separate individuals tested on their own, so we’ll assume one patient’s response doesn’t affect another’s — plausible, though the data don’t tell us how they were recruited ✓. Normality: n = 10 < 30, so the differences should look roughly normal. Most bunch between 0 and 2.5 hours, but one clear high outlier near 4.6 stands apart. Proceed with caution — the t-test is somewhat robust to mild non-normality with small n, but a large outlier can pull the result.

Sleep — T and Conclusion

Recall: \bar{x}_d = 1.58, s_d = 1.23, n = 10, df = 9.

  1. Compute SE and T. SE = 1.23 / \sqrt{10} \approx 0.389; T = 1.58 / 0.389 \approx 4.06.

  2. Two-sided p-value \approx 0.003 (df = 9). State your conclusion at \alpha = 0.05, including scope of inference. p \ll 0.05 → reject H_0. Convincing evidence that the two drugs are associated with different mean extra sleep (Drug 2 about 1.6 hours more than Drug 1 across patients). Scope: each patient is their own control, removing between-patient differences. But the drugs were given on alternate nights with no documented randomization of order, so order/carryover effects aren’t ruled out — be cautious attributing the gap purely to the drugs. And the patients weren’t a random sample, so the conclusion is strongest for patients like this group.

Looking Ahead

We’ve tested “Is the mean change (or difference) zero?” by reducing paired data to a single sample of differences.

Next time: a confidence interval for \mu_d — “How big is the mean change?” — using the same one-mean t machinery on the differences.

References

  • Introduction to Modern Statistics (2e) textbook by Mine Çetinkaya-Rundel and Johanna Hardin
  • Section 21.3
  • Cushny, A. R. & Peebles, A. R. (1905). The action of optical isomers: II hyoscines. The Journal of Physiology, 32, 501–510 — original source of the sleep data.
  • Student (1908). The probable error of a mean. Biometrika, 6(1) — the paper that introduced the t-test, using the Cushny & Peebles data as its worked example.