13. Inference for Paired Means

b. Confidence Interval
Math 115

Yurk

From Testing to Estimation

Still paired data: one within-pair difference \(d\) per unit, and we ask about \(\mu_d\), the mean of those differences.

The 13a test answered “Is the mean paired difference zero?”

Now: “How big is the mean paired difference?” → a confidence interval for \(\mu_d\).

Same paired machinery as 13a — work with the within-pair differences, then use the same \(SE = s_d / \sqrt{n}\) and \(df = n - 1\). New piece: a t critical value \(t^*\) replaces the test statistic. Just like 11b’s one-mean CI, with the “mean” being the mean of the differences.

Recap: Textbook Prices

How do textbook prices compare between the UCLA bookstore and Amazon? Sample of 68 UCLA-course textbooks priced at both stores; \(d\) = UCLA − Amazon.

n \(\bar{x}_d\) ($) \(s_d\) ($)
68 3.58 13.42

From 13a: \(T \approx 2.2\), p-value \(\approx 0.031\) → rejected \(H_0\) at \(\alpha = 0.05\) (with a caution about skew + outliers). Today: how big is the typical price gap?

CI Formula for Paired Mean

When conditions are met:

\[\text{CI} = \bar{x}_d \pm t^*_{df} \times \frac{s_d}{\sqrt{n}}\]

  • \(\bar{x}_d\) = sample mean of differences (the point estimate)
  • \(t^*_{df}\) = t critical value with \(df = n - 1\) (from Jamovi)
  • \(s_d / \sqrt{n}\) = standard error of the mean difference

Identical to one-mean CI from 11b, with \(\bar{x} \to \bar{x}_d\) and \(s \to s_d\). The “reduce to differences” trick gives back the full one-mean toolkit.

Conditions for the CI

Same conditions as the hypothesis test in 13a — applied to the differences:

  • Independence: different books from different courses → pairs independent of each other ✓
  • Normality: \(n = 68 \geq 30\) → CLT applies to the mean of differences ✓; right skew + a few large outliers → proceed with caution.

Same caution as 13a. With \(n = 68\) the CLT provides cover for the sampling distribution of \(\bar{x}_d\), but the borderline result invites careful interpretation.

Computing the 95% CI for Textbooks

From 13a: \(\bar{x}_d = 3.58\) dollars, \(s_d = 13.42\) dollars, \(n = 68\), \(df = 67\).

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

t critical value: \(t^*_{67} \approx 1.996\) (95% confidence; very close to \(z^* = 1.96\) since \(df\) is large).

Margin of error: \(ME = t^* \times SE \approx 1.996 \times 1.63 \approx 3.25\) dollars.

95% CI: \(\bar{x}_d \pm ME = 3.58 \pm 3.25 \approx (0.33, 6.83)\) dollars.

Interpreting the CI

95% CI: \((\$0.33, \$6.83)\) per book.

Interpretation: We are 95% confident that, on average, a textbook costs between $0.33 and $6.83 more at the UCLA bookstore than on Amazon.

Does the CI include 0? No — zero sits just below the entire interval.

This agrees with the 13a hypothesis test: rejected \(H_0\) ↔︎ zero is outside the CI. But the interval is wide — the data only pin the gap down to somewhere between about $0.30 and $7 per book.

Scope — generalization: not a documented random sample → the result covers only these books, not all UCLA Fall 2018 textbooks.

Scope — causation: not a randomized experiment → we can’t say the bookstore causes the higher price.

Sleep — CI Setup

How much more sleep, on average, does Drug 2 produce than Drug 1? Same 10-patient study as 13a (Cushny & Peebles, 1905; used as Student’s 1908 t-test example).

Recall the variable: each drug’s value is that patient’s extra sleep vs. no drug; the paired difference \(d\) = (Drug 2 extra) − (Drug 1 extra) — a difference in extra hours of sleep.

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

From 13a: \(T \approx 4.06\), p-value \(\approx 0.003\) → rejected \(H_0\).

  1. Are the conditions for the CI met? Independence: the patients are separate individuals tested on their own, so we 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 we’d want the differences roughly normal — most cluster between 0 and 2.4, but the 4.6 outlier nudges us toward caution. Same caveat as 13a — t inference is somewhat robust, but proceed with care.

Sleep — CI & Conclusion

Recall: \(\bar{x}_d = 1.58\), \(s_d = 1.23\), \(n = 10\), \(df = 9\). Use \(t^*_{9} \approx 2.262\) for 95% confidence (df is small, so \(t^*\) is noticeably larger than 1.96).

  1. Compute \(SE\), then the margin of error and 95% CI for \(\mu_d\). \(SE = \dfrac{s_d}{\sqrt{n}} = \dfrac{1.23}{\sqrt{10}} \approx 0.389\); \(ME = 2.262 \times 0.389 \approx 0.88\); 95% CI = \(1.58 \pm 0.88 \approx (0.7, 2.46)\) hours.

  2. Interpret and check consistency with the 13a hypothesis test. We’re 95% confident Drug 2 gives, on average, between about 0.7 and 2.46 hours more extra sleep than Drug 1 — roughly 40 minutes to 2.5 hours. The CI excludes 0, consistent with rejecting \(H_0\) in 13a.

  3. State the scope of inference. Scope: each patient is their own control (removes between-patient differences). But order wasn’t randomized (alternate nights) → order/carryover effects aren’t ruled out; and no random sample → strongest for patients like this group.

Factors Affecting Tests and CIs

H-tests — larger \(|T|\) → smaller p-value

\(T = \dfrac{\bar{x}_d}{SE}\)

  • Larger effect size \(|\bar{x}_d|\) → larger \(|T|\)
  • Larger sample size \(n\) (pairs) → smaller SE → larger \(|T|\)
  • Smaller variability \(s_d\) → smaller SE → larger \(|T|\)

CIs — narrower = more precise

\(\bar{x}_d \pm t^* \times SE\)

  • Larger sample size \(n\) → smaller SE and smaller \(t^*\) → narrower CI
  • Smaller variability \(s_d\) → smaller SE → narrower CI
  • Lower confidence level → smaller \(t^*\) → narrower CI

Why Pairing Pays Off

Imagine analyzing the textbooks the wrong way — as two independent samples of 68 prices (ignore which book is which).

Books vary enormously: prices run from about $7 to $229 (SD ≈ $57). But the two stores track each other — a pricey book is pricey at both, a cheap book cheap at both.

Which analysis gives the smaller SE — and why?

Paired wins, by a lot. Subtracting within each book removes the $7–$229 book-to-book variation, leaving only the $13 spread in the differences: paired \(SE \approx \$1.63\) vs. \(\approx \$9.52\) if treated as independent — about 6× larger. Ignoring the pairing would bury the real $3.58 gap in noise.

Strength of Evidence — Predict

Textbooks recap: \(n = 68\) pairs, \(\bar{x}_d \approx 3.58\), \(s_d \approx 13.42\) → \(T \approx 2.2\), p-value \(\approx 0.031\).

For each variant (others held constant), does the evidence become stronger or weaker?

  1. The researchers had sampled 272 textbooks instead of 68 (same \(\bar{x}_d\), same \(s_d\)). Stronger. Quadrupling \(n\) halves SE → \(|T|\) doubles. The original p-value of about 0.03 would drop well below 0.001.

  2. The observed mean difference had been $7 per book instead of about $3.58 (same \(n\), same \(s_d\)). Stronger. Larger \(|\bar{x}_d|\) → larger \(|T|\) directly.

  3. The differences had been more variable: \(s_d \approx \$25\) instead of \(\$13.42\) (same \(n\), same \(\bar{x}_d\)). Weaker. Larger \(s_d\) → larger SE → smaller \(|T|\). Pairing controls for between-subject variability, but the random scatter from book to book in the price difference itself still hurts.

CI Width — Predict

Textbooks recap: 95% CI for \(\mu_d\) = \((0.33,\ 6.83)\) dollars — width about $6.5.

For each variant (others held constant), does the CI become narrower or wider?

  1. The researchers had sampled 272 textbooks instead of 68 (same \(\bar{x}_d\), same \(s_d\)). Narrower. Larger \(n\) → smaller SE and slightly smaller \(t^*\) → narrower CI.

  2. They build a 90% CI instead of 95%. Narrower. Lower confidence → smaller \(t^*\) → narrower CI. (Less confidence buys precision.)

  3. The differences had been more variable: \(s_d \approx \$25\) instead of \(\$13.42\). Wider. Larger \(s_d\) → larger SE → wider CI.

The Pattern, One Last Time

Across the model-based topics (6, 10, 11, 12, 13), every inference question has the same shape:

Question Tool
Is there a difference / departure from null? Test statistic = (observed − null) / SE; reference distribution (normal or t)
How big is the effect? CI = statistic ± multiplier × SE

Only two things change topic-to-topic:

  1. The statistic (point estimate): \(\hat{p}\), \(\hat{p}_1 - \hat{p}_2\), \(\bar{x}\), \(\bar{x}_1 - \bar{x}_2\), \(\bar{x}_d\).
  2. The SE formula, which captures sampling variability for that statistic.

Conditions, reference distribution, and decision rules follow the same pattern every time.

Looking Ahead

That completes our work on single and paired groups: one proportion, two proportions, one mean, two independent means, and paired means. (Means and proportions aren’t gone for good — they resurface in later topics.)

Next: contingency tables — testing for an association between two categorical variables with more than two levels each. New reference distribution: chi-squared.

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.