Math 115
Previously, we compared two independent groups (different subjects).
Sometimes data come in pairs — two measurements on the same unit.
Examples of paired data:
For a paired design, response values come in pairs, with one response value in the pair for first group and one for the second group.
| Scenario | Paired or Independent? |
|---|---|
| Compare test scores of tutored vs. non-tutored students | Independent |
| Compare weight before and after a diet program | Paired repeated measures |
| Compare salaries of men vs. women at a company | Independent |
| Compare prices of same product at two stores | Paired repeated measures |
| Compare test results for two study strategies, matching students by pretesting | Paired using matching |
Key question: Is there a natural pairing between observations or can we define a pairing with matching?
Pairing controls for individual differences.
Example: Testing a new blood pressure medication
With paired data:
This reduces the two-sample problem to a one-sample problem!
We already know how to do this (Inference for a Single Mean).
| Statistic (sample) | Parameter (population) | |
|---|---|---|
| Mean difference | \(\bar{x}_d\) | \(\mu_d\) |
| SD of differences | \(s_d\) | \(\sigma_d\) |
Statistic of interest: \(\bar{x}_d\) (sample mean of differences)
Goal: Make inferences about \(\mu_d\) (population mean difference)
| One Mean | Paired Data | |
|---|---|---|
| Data | Single measurements | Differences |
| Statistic | \(\bar{x}\) | \(\bar{x}_d\) |
| Parameter | \(\mu\) | \(\mu_d\) |
| SE | \(s/\sqrt{n}\) | \(s_d/\sqrt{n}\) |
| df | \(n - 1\) | \(n_{pairs} - 1\) |
Same formulas, just applied to differences!
Will you save money buying textbooks from Amazon instead of the UCLA bookstore?
Research question: On average, do UCLA bookstore prices differ from Amazon prices?
| n | \(\bar{x}_d\) | \(s_d\) |
|---|---|---|
| 68 | $3.58 | $13.42 |
On average, UCLA bookstore prices are $3.58 higher than Amazon.
Let \(\mu_d\) = mean price difference (UCLA − Amazon) for all textbooks
Hypotheses:
This is a two-sided test.
| subject | course_num | bookstore_new | amazon_new | price_diff |
|---|---|---|---|---|
| American Indian Studies | M10 | 47.97 | 47.45 | 0.52 |
| subject | course_num | bookstore_new | amazon_new | price_diff |
|---|---|---|---|---|
| American Indian Studies | M10 | 47.97 | 47.45 | 0.52 |
Or
| subject | course_num | bookstore_new | amazon_new | price_diff |
|---|---|---|---|---|
| American Indian Studies | M10 | 47.45 | 47.97 | -0.52 |
Results:
Decision: Reject \(H_0\)
Conclusion: The data provide convincing evidence that, on average, UCLA bookstore prices differ from Amazon prices for textbooks.
Independence:
Normality:
We will proceed cautiously with using the t-distribution, but randomization would be preferred
Degrees of freedom: \(df = n - 1 = 68 - 1 = 67\)
Standard error:
\[SE = \frac{s_d}{\sqrt{n}} = \frac{13.42}{\sqrt{68}} = 1.63\]
T-statistic:
\[T = \frac{\bar{x}_d - 0}{SE} = \frac{3.58 - 0}{1.63} = 2.2\]
Use a t-distribution (df = 67).
P-value = 0.0312 (from Jamovi)
Results:
Decision: Reject \(H_0\)
Conclusion: The data provide convincing evidence that, on average, UCLA bookstore prices differ from Amazon prices for textbooks. However, we should be cautious given the skew and outliers present in the data. The randomization results are similar and verify this result.
Given: \(\bar{x}_d = 3.58\), \(SE = 1.63\), \(df = 67\)
Critical value: \(t^*_{67} = 1.996\) (from Jamovi)
95% CI:
\[3.58 \pm 1.996 \times 1.63 = (0.33, 6.83)\]
95% CI: ($0.33, $6.83)
Interpretation: We are 95% confident that the mean price difference (UCLA − Amazon) for all textbooks is between $0.33 and $6.83.
Does CI include 0? No
This is consistent with our hypothesis test—we rejected \(H_0\), and 0 is not in the CI. However, the results are different than the randomization which is more reliable for the highly skewed data.
Use paired analysis when there is a natural pairing:
Key insight: If you can match each observation in one group with exactly one observation in the other group, the data are paired.
Paired data → Compute differences → Analyze as one sample
| Component | Formula |
|---|---|
| Standard Error | \(SE = \frac{s_d}{\sqrt{n}}\) |
| Degrees of freedom | \(df = n_{pairs} - 1\) |
| T-statistic | \(T = \frac{\bar{x}_d - 0}{SE}\) |
| CI | \(\bar{x}_d \pm t^*_{df} \times SE\) |
Conditions: Independence of pairs + Normality of differences
Same as Topic 11, just applied to differences!