| 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 |
a. Hypothesis Test
Math 115
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 = 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).
Pairing controls for between-subject variability.
Example: want to know if a tutoring program raises test scores.
Paired designs are usually more efficient — smaller SE, more power for the same number of measurements.
Do textbook prices differ between the UCLA bookstore and Amazon? Sample of 68 textbooks from UCLA courses, each priced at both stores (Fall 2018).
Hypotheses (two-sided).
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.
| 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?
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 ⚠.
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}}
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.
For each scenario, decide whether the design is paired or unpaired (two independent groups), and name the statistic you’d use.
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).
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).
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.
Hypotheses (two-sided): H_0: \mu_d = 0 vs H_A: \mu_d \neq 0
Sample
Conditions met with caution (n = 68 \geq 30; right skew + outliers — keep the conclusion tentative).
Coming up: compute SE → T → p-value → conclude.
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.
Two-sided p-value = 2 × (smaller-tail area) ≈ 0.031.
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.
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.
Recall: n = 10, \bar{x}_d = 1.58, s_d = 1.23. With n < 30, the differences should look roughly normal.
Recall: \bar{x}_d = 1.58, s_d = 1.23, n = 10, df = 9.
Compute SE and T. SE = 1.23 / \sqrt{10} \approx 0.389; T = 1.58 / 0.389 \approx 4.06.
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.
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.