a. Hypothesis Test
Math 115
| Topic | Variables | Statistic | Example |
|---|---|---|---|
| 6 | One binary categorical | \hat{p} | Payday loans — fraction supporting regulation |
| 10 | Two binary categorical | \hat{p}_1 - \hat{p}_2 | CPR — survival rates by treatment |
| 11 (today) | One numerical | \bar{x} | Cherry Blossom — mean finish time |
| 12 | Numerical + binary categorical | \bar{x}_1 - \bar{x}_2 | Birth weights — by smoking habit |
Same framework throughout — only the statistic changes row to row.
Topic 2 introduced the sample mean as a way to describe a numerical variable’s center. Today it becomes our statistic of interest for inference — with notation that mirrors the proportions pattern.
| Quantity | Sample (statistic) | Population (parameter) |
|---|---|---|
| Center | \bar{x} (“x-bar”) | \mu (“mu”) |
| Spread | s | \sigma (“sigma”) |
\bar{x} and s come from the sample; \mu and \sigma are population values we want to learn about. Both pairs will show up in the formulas coming next.
Are runners getting faster or slower? Annual 10-mile race in Washington, D.C.
Hypotheses (two-sided). Let \mu = true mean finish time for all 2017 10-mile runners.
| n | mean (\bar{x}) | sd (s) | min | max |
|---|---|---|---|---|
| 100 | 99.02 | 17.93 | 53.3 | 139.1 |
Observed: sample mean is \bar{x} = 99.02 minutes — about 5.7 minutes higher than the 2006 mean of 93.29. Sampling noise, or a real shift?
When conditions are met, the sampling distribution of the sample mean is approximately normal with:
The catch: we don’t know the population SD \sigma.
Fix: substitute the sample SD s for \sigma, so SE \approx \dfrac{s}{\sqrt{n}}.
Try it: if we quadrupled the sample size (keeping s unchanged), what happens to SE?
SE shrinks by half: \sqrt{4n} = 2\sqrt{n}, so the denominator doubles. Halving SE costs four times the data.
Two conditions for inference about \mu from a single sample:
| Condition | Rule |
|---|---|
| Independence | Sample observations independent — typically from a random sample (with n < 10\% of the population), otherwise justified from study context |
| Normality | n \geq 30: data may show mild skew, but no extreme outliers. n < 30: data should look roughly normal. |
Try it: do both conditions hold for the Cherry Blossom sample? (The 2017 10-mile field had 17,442 runners.)
Independence: random sample of 2017 runners, n = 100 is well under 10% of the 17,442 10-mile runners ✓. Normality: n = 100 \geq 30 ✓; histogram is roughly symmetric with no extreme outliers ✓. Both conditions met.
The T-statistic measures how far \bar{x} is from the null value \mu_0, in SE units:
T = \frac{\bar{x} - \mu_0}{s / \sqrt{n}}
Where:
Same formula structure as Z — observed minus null over SE. But T uses s in place of \sigma, so under H_0 it doesn’t quite follow the standard normal. It needs its own reference distribution — coming up next.
Under H_0, T = (\bar{x} - \mu_0)/(s/\sqrt{n}) follows a t-distribution with degrees of freedom df = n - 1.
A p-value comes from an area under the appropriate t-distribution — we’ll walk through one when we work through Cherry Blossom.
For each scenario, identify the statistic of interest and the test statistic (Z or T).
A pre-election poll asks 500 voters about a ballot measure. Is the percentage who support it different from 50%? Statistic: \hat{p} (single proportion). Test statistic: Z — normal model (topic 6).
A clinical trial randomly assigns patients to a new drug or placebo. Do the recovery rates differ between groups? Statistic: \hat{p}_1 - \hat{p}_2 (difference of proportions). Test statistic: Z — normal model (topic 10).
A nutrition study measures sodium content in 40 fast-food burgers. Is the mean sodium content different from 1200 mg? Statistic: \bar{x} (single mean). Test statistic: T — t-distribution with df = n - 1 (today).
Hypotheses (two-sided): H_0: \mu = 93.29 vs H_A: \mu \neq 93.29
Sample
Conditions met (random sample; n = 100 \geq 30; no extreme outliers). Coming up: compute SE → compute T → get p-value → conclude.
SE: \dfrac{s}{\sqrt{n}} = \dfrac{17.93}{\sqrt{100}} \approx 1.793 minutes
Try it: plug into T = \dfrac{\bar{x} - \mu_0}{SE} with \bar{x} = 99.02, \mu_0 = 93.29, SE \approx 1.793.
T = \dfrac{99.02 - 93.29}{1.793} \approx 3.19 — the sample mean sits about 3.2 SEs above the 2006 value.
Two-sided p-value = 2 × (smaller-tail area) \approx 0.0019
Results: T \approx 3.19 (df = 99), p-value \approx 0.0019 — well below 0.05 → reject H_0.
Conclusion: Convincing evidence that the mean finish time for 2017 Cherry Blossom 10-mile runners differs from 93.29 minutes, the mean from 2006.
In plain terms: the 2017 sample mean was about 5.7 minutes higher than 93.29 — runners were noticeably slower, and a difference this large is very unusual by chance.
Scope: random sample of 2017 runners → conclusion extends to all 2017 10-mile runners.
Is the average body temperature really 98.6°F? The 98.6 value comes from 19th-century work by Wunderlich; modern work suggests it’s lower.
Data: a random sample of n = 30 healthy adults with \bar{x} = 98.25^\circF, s = 0.73^\circF (sample stats from Shoemaker, 1996; based on Mackowiak et al., 1992).
State H_0 and H_A for \mu = true mean body temperature (two-sided). H_0: \mu = 98.6 H_A: \mu \neq 98.6
What is \bar{x} - \mu_0? In which direction? 98.25 - 98.6 = -0.35^\circF. Sample mean is lower than the 98.6 reference — consistent with the modern challenge to Wunderlich’s value.
Recall: n = 30, \bar{x} = 98.25, s = 0.73, \mu_0 = 98.6.
Check independence. Random sample of healthy adults ✓ — observations should be independent.
Check normality. n = 30 meets the rule of thumb (n \geq 30) ✓. With raw data we’d also look for strong skew or extreme outliers; body temperatures for healthy adults are typically near-symmetric, so we’ll assume that’s fine.
Recall: \bar{x} = 98.25, s = 0.73, n = 30, \mu_0 = 98.6; conditions met.
Compute the degrees of freedom. df = n - 1 = 29
Compute the standard error. SE = s / \sqrt{n} = 0.73 / \sqrt{30} \approx 0.133
Compute T. T = (\bar{x} - \mu_0) / SE = (98.25 - 98.6) / 0.133 \approx -2.63
The two-sided p-value is about 0.014. Conclusion at \alpha = 0.05, including scope? p-value < 0.05 → reject H_0. Convincing evidence the true mean body temperature differs from 98.6°F (and the sample suggests it’s lower). Scope: random sample → conclusion generalizes to all healthy adults.
We’ve tested “Is the true mean equal to \mu_0?” with the t-distribution.
Next time: a confidence interval for \mu — “What’s a plausible range for the true mean?” — using the same t-distribution machinery.
What about randomization? Simulation-based methods (like topics 3 and 9 for proportions) also exist for means and work in a similar way — useful when normality is in question (though they carry their own assumptions). We won’t cover them in the slides; you’ll meet them in a later lab.