| Group | Died | Survived | Total |
|---|---|---|---|
| Control | 39 | 11 | 50 |
| Treatment | 26 | 14 | 40 |
| Total | 65 | 25 | 90 |
Math 115
Previously, we used randomization for two-proportion inference:
These methods work well, but require many simulations.
Question: Is there a mathematical shortcut?
Just as we used the normal distribution for one proportion…
We can use the normal distribution for the difference in proportions!
When conditions are met:
When conditions are met, the sampling distribution is approximately normal with:
This parallels what we learned for a single proportion.
To use the normal model for two proportions:
Note: How we check success-failure differs for H-test vs CI
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}\]
Important: Used ONLY for hypothesis testing, not for confidence intervals.
For Hypothesis Testing (uses pooled proportion):
\[SE = \sqrt{\hat{p}_{pool}(1-\hat{p}_{pool})\left(\frac{1}{n_1} + \frac{1}{n_2}\right)}\]
For Confidence Intervals (uses separate proportions):
\[SE = \sqrt{\frac{\hat{p}_1(1-\hat{p}_1)}{n_1} + \frac{\hat{p}_2(1-\hat{p}_2)}{n_2}}\]
Why different? H-test assumes null is true (equal proportions); CI makes no such assumption.
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:
Researchers studied whether 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 |
Observed difference: \(\hat{p}_T - \hat{p}_C = 0.35 - 0.22 = 0.13\)
Let \(p_T\) = true survival rate for treatment, \(p_C\) = true survival rate for control
Hypotheses:
This is a two-sided test.
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\)
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\]
Z-score:
\[Z = \frac{0.13 - 0}{0.095} = 1.37\]
Results:
Conclusion: The data do not provide convincing evidence that blood thinners affect survival rate during CPR.
When conditions are met:
\[\text{CI} = (\hat{p}_1 - \hat{p}_2) \pm z^* \times SE\]
Where SE uses separate sample proportions:
\[SE = \sqrt{\frac{\hat{p}_1(1-\hat{p}_1)}{n_1} + \frac{\hat{p}_2(1-\hat{p}_2)}{n_2}}\]
Multipliers: 90% → 1.645, 95% → 1.96, 99% → 2.576
Independence: Randomized experiment ✓
Success-Failure: Using observed counts (not pooled)
Conditions are met for using the normal model.
SE (using separate proportions):
\[SE = \sqrt{\frac{0.35 \times 0.65}{40} + \frac{0.22 \times 0.78}{50}} = 0.0955\]
95% CI:
\[0.13 \pm 1.96 \times 0.0955 = 0.13 \pm 0.187\]
\[(-0.057, 0.317)\]
95% Confidence Interval: (-0.057, 0.317)
Interpretation: We are 95% confident that the true difference in survival rates (treatment - control) is between -0.057 and 0.317.
Does CI include 0? Yes → Consistent with failing to reject \(H_0\)
| Method | Purpose | CPR Study Result |
|---|---|---|
| Permutation test | H-test | p-value ≈ 0.23 |
| Normal approximation | H-test | p-value = 0.171 |
| Bootstrap CI | Estimation | 95% CI: (-0.065, 0.311) |
| Normal CI | Estimation | 95% CI: (-0.057, 0.317) |
All methods tell the same story: no convincing evidence of a difference.
| Randomization | Normal Model | |
|---|---|---|
| Conditions | Always works | Requires large sample |
| Computation | Many simulations | Formula-based |
| When conditions NOT met | Use this | Results may be unreliable |
| Software | Jamovi Randomize | Jamovi Randomize (Model-Based) |
For hypothesis testing, stronger evidence = smaller p-value = larger |Z|
Recall: \(Z = \frac{(\hat{p}_1 - \hat{p}_2) - 0}{SE}\) where \(SE = \sqrt{\hat{p}_{pool}(1-\hat{p}_{pool})\left(\frac{1}{n_1} + \frac{1}{n_2}\right)}\)
Three factors affect |Z| (and thus p-value):
For confidence intervals: Width = \(2 \times z^* \times SE\)
Where \(SE = \sqrt{\frac{\hat{p}_1(1-\hat{p}_1)}{n_1} + \frac{\hat{p}_2(1-\hat{p}_2)}{n_2}}\)
Three factors affect width:
Confidence level: Higher confidence → larger \(z^*\) → wider CI
Sample size: Larger \(n_1\) and \(n_2\) → smaller SE → narrower CI
Variability: Proportions near 0.5 → larger SE → wider CI
Sampling distribution of \(\hat{p}_1 - \hat{p}_2\) is approximately normal when conditions are met
For Hypothesis Testing:
For Confidence Intervals:
When conditions met: Normal model gives similar results to randomization