| Group | Died | Survived | Total |
|---|---|---|---|
| Control | 39 | 11 | 50 |
| Treatment | 26 | 14 | 40 |
| Total | 65 | 25 | 90 |
a. Hypothesis Test
Math 115
Previously, we used randomization for two-proportion inference:
These methods work well, but require many simulations.
Question: Is there a mathematical shortcut?
Do blood thinners affect survival during CPR? 90 patients randomly assigned to treatment (blood thinner) or control.
| Group | Died | Survived | Total |
|---|---|---|---|
| Control | 39 | 11 | 50 |
| Treatment | 26 | 14 | 40 |
| Total | 65 | 25 | 90 |
Hypotheses (two-sided)
p_T, p_C = true survival rates (treatment, control).
From 9a: permutation p-value \approx 0.27 → failed to reject H_0. Today: does the normal model agree?
Just as we used the normal distribution for one proportion…
Topic 6: \hat{p} \sim N\!\left(p,\ \sqrt{p(1-p)/n}\right) when conditions hold — sampling distribution from theory, no simulation.
We can use the normal distribution for the difference in proportions too.
When conditions are met:
Today’s goal: redo the CPR H-test with the normal model and see how the answer compares to 9a’s permutation result.
When conditions are met, the sampling distribution is approximately normal with:
Another CLT result. Just like \hat{p} in topic 6, the difference \hat{p}_1 - \hat{p}_2 becomes approximately normal under independence + adequate sample size.
The SE uses the true p_1, p_2. What to plug in depends on the question — pooled \hat{p}_{pool} for an H-test (today), separate \hat{p}_1, \hat{p}_2 for a CI (10b).
Two conditions to use the normal model for an H-test on two proportions:
| Condition | Rule | For CPR |
|---|---|---|
| Independence | Observations independent within and between groups (random sampling or random assignment) | randomized assignment ✓ |
| Success-Failure | At least 10 expected successes AND failures in each group (expected = under H_0 using \hat{p}_{pool}, next slide) | needs checking, next ? |
H-test uses expected counts under H_0 (via \hat{p}_{pool}); CI uses observed counts (each group on its own).
Under H_0: p_1 - p_2 = 0, both groups share a common proportion.
The pooled proportion estimates this common value:
\hat{p}_{pool} = \frac{\text{total successes}}{\text{total observations}} = \frac{n_1\hat{p}_1 + n_2\hat{p}_2}{n_1 + n_2}
Used for hypothesis testing because the null assumes the two proportions are equal.
Try it for CPR (total survivors / total patients):
\hat{p}_{pool} = \dfrac{25}{90} \approx 0.28 — best estimate of the common survival rate under H_0.
The test statistic for a hypothesis test about a difference in proportions is the Z-score:
Z = \frac{(\hat{p}_1 - \hat{p}_2) - 0}{SE}
Where:
Both p_1, p_2 in the theoretical SE are replaced by \hat{p}_{pool} — under H_0 they’re equal.
Hypotheses (two-sided): H_0: p_T - p_C = 0 vs H_A: p_T - p_C \neq 0
Sample
Under H_0: \hat{p}_{pool} = 25/90 \approx 0.28
Coming up: check success-failure → compute pooled SE → get Z → get p-value → conclude.
To check the success-failure condition, we calculate expected counts using \hat{p}_{pool}.
Expected successes and failures in each group:
All four values must be ≥ 10.
Independence: Randomized experiment ✓
Success-Failure: Using pooled proportion \hat{p}_{pool} = \frac{25}{90} = 0.278
- Treatment: 40 \times 0.278 = 11.1 expected successes ✓
- Treatment: 40 \times 0.722 = 28.9 expected failures ✓
- Control: 50 \times 0.278 = 13.9 expected successes ✓
- Control: 50 \times 0.722 = 36.1 expected failures ✓
All ≥ 10, so conditions are met.
Pooled SE:
SE = \sqrt{0.278 \times 0.722 \times \left(\frac{1}{40} + \frac{1}{50}\right)} = 0.095
Try it: plug into Z = \dfrac{(\hat{p}_T - \hat{p}_C) - 0}{SE}.
Z = \dfrac{0.13 - 0}{0.095} \approx 1.37 — a Z of about 1.4 is mildly large but not extreme.
Two-sided p-value = 2 × (smaller-tail area) = 2 \times 0.0856 \approx 0.171
Results:
Conclusion: The data do not provide convincing evidence that blood thinners affect survival rate during CPR.
In plain terms: if blood thinner had no effect on survival, we’d see a gap this extreme or more — in either direction — about 17% of the time just by chance.
Scope of inference:
Do stents affect stroke rate? Same study from 9a — patients were randomly assigned to stent (224) vs. control (227); not a random sample. From 9a: permutation p-value \approx 0.004 → rejected H_0.
| Group | No event | Stroke | Total |
|---|---|---|---|
| Control | 214 | 13 | 227 |
| Treatment | 191 | 33 | 224 |
| Total | 405 | 46 | 451 |
State H_0 and H_A for p_T - p_C (two-sided). H_0: p_T - p_C = 0 H_A: p_T - p_C \neq 0
Compute \hat{p}_T, \hat{p}_C, and the observed difference \hat{p}_T - \hat{p}_C. \hat{p}_T = 33/224 \approx 0.147; \hat{p}_C = 13/227 \approx 0.057; \hat{p}_T - \hat{p}_C \approx 0.090
| Group | No event | Stroke | Total |
|---|---|---|---|
| Control | 214 | 13 | 227 |
| Treatment | 191 | 33 | 224 |
| Total | 405 | 46 | 451 |
Compute \hat{p}_{pool}. \hat{p}_{pool} = 46/451 \approx 0.102
Check success-failure: are all four expected counts ≥ 10? Treatment: 224 \times 0.102 \approx 22.8 successes; 224 \times 0.898 \approx 201.2 failures.
Control: 227 \times 0.102 \approx 23.2 successes; 227 \times 0.898 \approx 203.8 failures. All four ≥ 10 ✓
Recall: observed difference \approx 0.090; \hat{p}_{pool} \approx 0.102; conditions met. Random assignment; not a random sample.
Compute the pooled SE. SE = \sqrt{0.102 \times 0.898 \times (1/224 + 1/227)} \approx 0.0285
Compute Z. Z = 0.090 / 0.0285 \approx 3.16
Two-sided p-value for Z \approx 3.16 is about 0.0016. Conclusion at \alpha = 0.05 (including scope)? p \ll 0.05 → reject H_0. Stents affect stroke rate. Causation: randomized → causal. Generalization: not a random sample → applies to similar populations only. Matches 9a’s conclusion.
We’ve tested “Is there a difference?” with the normal model.
Next time: a normal CI for p_1 - p_2 — “How big is the difference?”