| Group | Died | Survived | Total |
|---|---|---|---|
| Control | 39 | 11 | 50 |
| Treatment | 26 | 14 | 40 |
| Total | 65 | 25 | 90 |
a. Permutation Test
Math 115
Previously: Inference for a single proportion
Now: Inference for comparing two proportions
When we have two binary categorical variables:
We compare the proportion of successes between groups
Examples:
Researchers studied whether blood thinners affect survival during CPR
Research question: Does blood thinner affect survival rate?
Let p_T = true survival rate for treatment, p_C = true survival rate for control
Hypotheses:
Sometimes we state the hypotheses in words as
| Group | Died | Survived | Total |
|---|---|---|---|
| Control | 39 | 11 | 50 |
| Treatment | 26 | 14 | 40 |
| Total | 65 | 25 | 90 |
Survival proportions:
For single proportion: We used a spinner to simulate outcomes under the null
For two proportions: We’re testing H_0: p_1 - p_2 = 0
Under the null hypothesis (p_T = p_C):
Key idea: If group doesn’t matter, we can shuffle the outcomes!
A permutation randomly reassigns the response values (outcomes):
After shuffling, we calculate the difference in proportions
This gives us ONE value from the null distribution
View interactive permutation demo
The demo shows:
The null distribution shows what differences we’d expect if there’s truly no effect (i.e., if H_0 is true)
1000 permutations. Centered at 0 (as expected under null). Shaded region shows the smaller tail used for p-value.
Rule: Split the null at the observed value, then double the smaller-tail proportion.
For the CPR null distribution (1000 permutations), observed difference = 0.13:
Results:
Conclusion: The data do not provide convincing evidence that blood thinners affect survival rate during CPR.
Scope of inference:
A study randomly assigned 80 students to learn a topic either by active learning (working problems with peers) or traditional lecture, then quizzed them.
| Group | Pass | Fail | Total |
|---|---|---|---|
| Active learning | 28 | 12 | 40 |
| Traditional lecture | 20 | 20 | 40 |
| Total | 48 | 32 | 80 |
Research question: Does active learning improve pass rates compared to traditional lecture?
For the active learning study (active: 28/40 pass; traditional: 20/40 pass):
State H_0 and H_A for p_A - p_T (pass rate, active − traditional). H_0: p_A - p_T = 0
H_A: p_A - p_T \neq 0
no association vs. association between teaching method and passing
Compute \hat{p}_A and \hat{p}_T. \hat{p}_A = 28/40 = 0.70
\hat{p}_T = 20/40 = 0.50
Compute the observed difference \hat{p}_A - \hat{p}_T. \hat{p}_A - \hat{p}_T = 0.70 - 0.50 = 0.20 — a 20 percentage-point higher pass rate in the active group
1000 permutations under H_0: p_A = p_T. Each bar’s height is the number of shuffles whose \hat{p}_A - \hat{p}_T landed there. Shaded right tail: shuffles with a gap \geq 0.20 (our observed).
Compute the two-sided p-value. Smaller-tail sum: 43 + 18 + 3 = 64 of 1000
Proportion: 64 / 1000 = 0.064
p-value: 2 \times 0.064 = 0.128
State your conclusion at \alpha = 0.05, including scope of inference. Fail to reject H_0 at \alpha = 0.05. The data do not provide convincing evidence that active learning affects pass rates. If active and traditional truly had the same pass rate, we’d see a difference this extreme or more — in either direction — about 12.8% of the time by chance. Causation: randomly assigned → a significant result would have supported a causal claim. Generalization: not a random sample → conclusion applies to similar students in similar settings only.
A study randomly assigned 451 patients with brain blockages to receive either a stent or standard care alone. Outcome: stroke within 30 days.
| 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 (stroke rate, treatment − control). H_0: p_T - p_C = 0
H_A: p_T - p_C \neq 0
no association vs. association between stent use and stroke
Compute the observed difference \hat{p}_T - \hat{p}_C (stroke rate). \hat{p}_T = 33/224 \approx 0.147
\hat{p}_C = 13/227 \approx 0.057
\hat{p}_T - \hat{p}_C \approx 0.147 - 0.057 = 0.090 — stents are associated with a 9 percentage-point higher stroke rate
From the stent study: observed diff \approx 0.090, permutation p-value \approx 0.004.
The permutation test assumes exchangeability under the null:
The permutation test answers: “Is there a difference?”
Next time: a bootstrap CI for p_1 - p_2 — “How big is the difference?”