| Group | Passed | Failed | Total |
|---|---|---|---|
| Tutoring | 76 | 14 | 90 |
| Control | 63 | 27 | 90 |
| Total | 139 | 41 | 180 |
10. Two Proportions (Normal)
Math 115 - Examples for Topic 10
These worked examples demonstrate inference for comparing two proportions using the normal distribution (model-based approach).
Example 1: Hypothesis Test Using Normal Model
Scenario: A university wants to know if providing free tutoring services affects whether students pass introductory statistics. They randomly assigned 180 students to two groups:
- Tutoring group: Offered free tutoring sessions (90 students)
- Control group: No additional support offered (90 students)
At the end of the semester, they recorded whether each student passed the course.
Research question: Is there evidence that the pass rate differs between the tutoring and control groups?
Task: Conduct a hypothesis test at the \(\alpha = 0.05\) level using the normal model.
Step 1: Identify the parameter and calculate sample statistic
Let \(p_T\) = the true pass rate for students offered tutoring
Let \(p_C\) = the true pass rate for students in the control group
The parameter of interest is \(p_T - p_C\), the difference in pass rates between groups.
Sample proportions:
- Tutoring group: \(\hat{p}_T = \frac{76}{90} = 0.844\)
- Control group: \(\hat{p}_C = \frac{63}{90} = 0.7\)
- Observed difference: \(\hat{p}_T - \hat{p}_C = 0.844 - 0.7 = 0.144\)
Step 2: State the hypotheses
Since we want to test whether the pass rate differs (in either direction), this is a two-sided test:
- \(H_0: p_T - p_C = 0\) (no difference in pass rates)
- \(H_A: p_T - p_C \neq 0\) (pass rates differ)
Step 3: Check conditions for using normal model
Independence:
- Randomized experiment with independent groups ✓
Success-Failure Condition: For a hypothesis test, we use the pooled proportion to calculate expected counts.
Pooled proportion:
\[\hat{p}_{pool} = \frac{\text{total passed}}{\text{total students}} = \frac{139}{180} = 0.772\]
Expected counts using pooled proportion:
- Tutoring group:
- Expected successes: \(90 \times 0.772 = 69.5\) ≥ 10 ✓
- Expected failures: \(90 \times 0.228 = 20.5\) ≥ 10 ✓
- Control group:
- Expected successes: \(90 \times 0.772 = 69.5\) ≥ 10 ✓
- Expected failures: \(90 \times 0.228 = 20.5\) ≥ 10 ✓
All conditions are met, so we can use the normal model.
Step 4: Calculate the test statistic
Standard error (using pooled proportion):
\[SE = \sqrt{\hat{p}_{pool}(1-\hat{p}_{pool})\left(\frac{1}{n_1} + \frac{1}{n_2}\right)} = \sqrt{0.772 \times 0.228 \times \left(\frac{1}{90} + \frac{1}{90}\right)} = 0.0625\]
Z-score:
\[Z = \frac{(\hat{p}_T - \hat{p}_C) - 0}{SE} = \frac{0.144 - 0}{0.0625} = 2.31\]
Step 5: Calculate the p-value using Jamovi
Randomize module → Model-Based Inference
To calculate the p-value in Jamovi:
- Under Distribution, choose Standard normal (Z)
- Check “Calculate area (p-value)”
- Enter the Z-score: 2.31
- Select tail direction: Both (for two-sided test)
Jamovi calculates the two-sided p-value using the “double the smaller tail” method:
- Area to the right of Z = 2.31: 0.0104
- Area to the left of Z = 2.31: 0.9896
- Smaller tail: 0.0104
- Two-sided p-value = 2 × 0.0104 = 0.0209
Step 6: Interpret the p-value
Interpretation: If there were truly no difference in pass rates between the tutoring and control groups, there is approximately a 2.09% chance of observing a difference as extreme as 0.144 (or more extreme) in a random sample.
Step 7: Make a decision
Using the significance level α = 0.05:
- P-value = 0.0209
- Compare: Is 0.0209 < 0.05? YES
Decision: We reject \(H_0\) at the α = 0.05 level.
Step 8: State the conclusion in context
The data provide convincing evidence that there is a difference in pass rates between the tutoring and control groups. Since this was a randomized experiment, we can conclude that offering tutoring causes an increase in pass rates. The tutoring group had a pass rate 14.4 percentage points higher than the control group (Z = 2.31, p-value = 0.0209).
Example 2: Confidence Interval Using Normal Model
Scenario: Using the same tutoring study from Example 1, construct a 95% confidence interval for the true difference in pass rates between the tutoring and control groups.
Recall from Example 1:
- Tutoring group: 76 out of 90 passed
- Control group: 63 out of 90 passed
Task: Use the normal model to construct a 95% confidence interval for \(p_T - p_C\).
Step 1: Identify the parameter and point estimate
The parameter of interest is \(p_T - p_C\), the true difference in pass rates between students offered tutoring and students in the control group.
From Example 1:
- \(\hat{p}_T = 0.844\)
- \(\hat{p}_C = 0.7\)
- Observed difference: \(\hat{p}_T - \hat{p}_C = 0.144\)
Step 2: Check conditions for using normal model
Independence: Randomized experiment with independent groups ✓
Success-Failure Condition: For a confidence interval, we use observed counts (not pooled proportion).
- Tutoring: 76 passed, 14 failed (both ≥ 10) ✓
- Control: 63 passed, 27 failed (both ≥ 10) ✓
Conditions are met for using the normal model.
Step 3: Calculate the standard error
For confidence intervals, use separate proportions (not pooled):
\[SE = \sqrt{\frac{\hat{p}_T(1-\hat{p}_T)}{n_T} + \frac{\hat{p}_C(1-\hat{p}_C)}{n_C}}\]
\[SE = \sqrt{\frac{0.844 \times 0.156}{90} + \frac{0.7 \times 0.3}{90}} = 0.0616\]
Note: This is a different SE formula than the one used for the hypothesis test!
Step 4: Find the critical value using Jamovi
Randomize module → Model-Based Inference
To find \(z^*\) in Jamovi:
- Under Distribution, choose Standard normal (Z)
- Check “Calculate CI multiplier”
- Enter confidence level: 95
Jamovi returns: \(z^* = 1.960\)
Step 5: Calculate the confidence interval
Margin of error:
\[ME = z^* \times SE = 1.960 \times 0.0616 = 0.1207\]
Confidence interval:
\[\text{CI} = (\hat{p}_T - \hat{p}_C) \pm ME = 0.144 \pm 0.121\]
\[95\% \text{ CI} = (0.024, 0.265)\]
Step 6: Interpret the confidence interval
Interpretation: We are 95% confident that the true difference in pass rates (tutoring − control) is between 0.024 and 0.265.
In practical terms:
- Both bounds are positive, indicating the tutoring group has a higher pass rate
- We’re confident tutoring increases pass rates by somewhere between 2.4 and 26.5 percentage points
Step 7: Connect to hypothesis test
Does the 95% CI include 0?
- CI: (0.024, 0.265)
- 0 is NOT in the interval
This is consistent with our hypothesis test result: since 0 is not a plausible value, we rejected \(H_0\).
Example 3: Full Inference Workflow — Sulphinpyrazone Trial
Scenario: The Anturane Reinfarction Trial (1980) examined whether sulphinpyrazone, an anti-clotting drug, prevents sudden cardiac death in patients who had recently survived a myocardial infarction (heart attack). Researchers randomly assigned 1,475 MI survivors to receive sulphinpyrazone or a placebo, then tracked deaths through follow-up. Patients were volunteers recruited from clinical settings — not a random sample.
The original paper’s primary endpoint was sudden cardiac death, and the published headline finding was a significant reduction in that specific endpoint on an “analyzable” patient subgroup. The dataset used here (openintro::sulphinpyrazone) records all-cause deaths for the full 1,475-patient cohort, and the analysis below is therefore an analysis of that outcome — not a replication of the paper’s primary finding. The FDA’s contemporaneous reanalysis of the trial’s full cohort reached a conclusion closer to what we compute here.
| Group | Died | Lived | Total |
|---|---|---|---|
| Control (placebo) | 60 | 682 | 742 |
| Treatment (sulphinpyrazone) | 41 | 692 | 733 |
| Total | 101 | 1374 | 1475 |
Research question: Does sulphinpyrazone affect death rates after a heart attack?
Task: Conduct a two-sided hypothesis test at \(\alpha = 0.05\) AND construct a 95% confidence interval for \(p_T - p_C\). State the scope of inference and give a final conclusion in context.
Step 1: Set up the parameter and state hypotheses
Let \(p_T\) = the true death rate among MI survivors taking sulphinpyrazone.
Let \(p_C\) = the true death rate among MI survivors taking placebo.
The parameter of interest is \(p_T - p_C\), the difference in death rates between treatment and placebo.
Since we test whether the rates differ (in either direction), this is a two-sided test:
- \(H_0: p_T - p_C = 0\) (no difference in death rates)
- \(H_A: p_T - p_C \neq 0\) (death rates differ)
Step 2: Calculate the sample statistics
- Treatment: \(\hat{p}_T = \dfrac{41}{733} = 0.0559\)
- Control: \(\hat{p}_C = \dfrac{60}{742} = 0.0809\)
- Observed difference: \(\hat{p}_T - \hat{p}_C = 0.0559 - 0.0809 = -0.0249\)
The treatment group’s death rate is about 2.5 percentage points lower than placebo. We now ask whether this gap is statistically significant.
Step 3: Hypothesis test — check conditions
Independence: Randomized experiment with independent groups ✓
Success-Failure (for the H-test, use pooled expected counts):
Pooled proportion:
\[\hat{p}_{pool} = \frac{\text{total deaths}}{\text{total patients}} = \frac{101}{1475} = 0.0685\]
Expected counts under \(H_0\):
- Treatment: \(733 \times 0.0685 = 50.2\) deaths; \(733 \times 0.9315 = 682.8\) no-deaths. Both ≥ 10 ✓
- Control: \(742 \times 0.0685 = 50.8\) deaths; \(742 \times 0.9315 = 691.2\) no-deaths. Both ≥ 10 ✓
All conditions met — we can use the normal model.
Step 4: Hypothesis test — calculate \(Z\)
Pooled standard error:
\[SE = \sqrt{\hat{p}_{pool}(1-\hat{p}_{pool})\left(\frac{1}{n_T} + \frac{1}{n_C}\right)} = \sqrt{0.0685 \times 0.9315 \times \left(\frac{1}{733} + \frac{1}{742}\right)} = 0.0132\]
Z-score:
\[Z = \frac{(\hat{p}_T - \hat{p}_C) - 0}{SE} = \frac{-0.0249}{0.0132} = -1.9\]
Step 5: Hypothesis test — p-value and decision
Two-sided p-value (course convention: double the smaller tail):
- Area to the left of \(Z = -1.9\): \(0.029\)
- Area to the right of \(Z = -1.9\): \(0.971\)
- Smaller tail: \(0.029\)
- p-value = \(2 \times 0.029 = 0.058\)
Compare to \(\alpha = 0.05\): is \(0.058 < 0.05\)? NO
Decision: Do not reject \(H_0\) at the \(\alpha = 0.05\) level.
Step 6: Confidence interval — check conditions
For a confidence interval, the success-failure check uses observed counts (not pooled):
- Treatment: 41 died, 692 lived (both ≥ 10) ✓
- Control: 60 died, 682 lived (both ≥ 10) ✓
Step 7: Confidence interval — compute SE, ME, and CI
SE for the CI (use separate proportions):
\[SE = \sqrt{\frac{\hat{p}_T(1-\hat{p}_T)}{n_T} + \frac{\hat{p}_C(1-\hat{p}_C)}{n_C}} = \sqrt{\frac{0.0559 \times 0.9441}{733} + \frac{0.0809 \times 0.9191}{742}} = 0.0131\]
Note: In this case, the pooled SE and the separate-proportion SE round to about the same value, because \(\hat{p}_T\) and \(\hat{p}_C\) are both close to \(\hat{p}_{pool}\). They are not identical formulas — they happen to produce similar numbers here.
Margin of error: \(ME = z^* \times SE = 1.96 \times 0.0131 \approx 0.0257\)
95% CI:
\[(\hat{p}_T - \hat{p}_C) \pm ME = -0.0249 \pm 0.0257 = (-0.0506,\ 8\times 10^{-4})\]
Step 8: Interpret the CI and connect to the H-test
Interpretation: We are 95% confident that the true difference in death rates (\(p_T - p_C\)) is between \(-0.0506\) and \(8\times 10^{-4}\). In plain terms: the treatment death rate is somewhere between about 5 percentage points lower than placebo and roughly equal to placebo.
Connection to the H-test: The CI just barely includes 0, which is consistent with our decision to fail to reject \(H_0\).
Step 9: Scope of inference (recall 8a / 8b)
- Causation: Patients were randomly assigned to treatment or placebo, so the design supports causal claims. However, we failed to reject \(H_0\), so we make no causal claim about sulphinpyrazone here. (Had we rejected, the random assignment would have supported the claim that sulphinpyrazone caused the difference.)
- Generalization: Patients were not a random sample — they were MI-survivor volunteers from clinical settings, screened for eligibility. Conclusions apply only to similar patient populations in similar clinical settings, not to the general public.
Step 10: Final conclusion in context
This full-cohort analysis of the trial data does not provide convincing evidence that sulphinpyrazone affects all-cause death rates among heart-attack survivors at \(\alpha = 0.05\) (\(Z = -1.9\), p-value \(= 0.058\)). The 95% confidence interval for the difference in death rates is \((-0.0506,\ 8\times 10^{-4})\), which just barely includes 0. The direction is consistent with a possible benefit of treatment — 2.5 percentage points fewer deaths in the sulphinpyrazone group than in placebo — but the evidence is not strong enough to rule out chance. Because patients were randomly assigned but were not a random sample, any future significant finding would support a causal claim limited to similar MI-survivor populations in similar clinical settings.
Example 4: Factors Affecting Strength of Evidence and CI Width
These questions ask you to think about what affects the strength of evidence against the null hypothesis and confidence interval width.
Part A: Sample Size and Strength of Evidence
Scenario: Dr. Martinez conducts a study comparing a new medication to a placebo. With 50 patients per group, she observes that 60% of the medication group improved compared to 48% of the placebo group. Her p-value is 0.21.
Dr. Martinez’s colleague, Dr. Chen, conducts an identical study but with 200 patients per group. He observes the exact same proportions: 60% improved in the medication group and 48% in the placebo group.
Question: Will Dr. Chen’s p-value be larger, smaller, or about the same as Dr. Martinez’s p-value of 0.21?
Dr. Chen’s p-value will be smaller (stronger evidence against \(H_0\)).
With a larger sample size, the standard error decreases, which makes the Z-score larger. A larger Z-score corresponds to a smaller p-value. Even though both studies observed the same 12 percentage point difference, the larger study provides stronger evidence that this difference is real and not due to chance.
Part B: Sample Size and CI Width
Scenario: Using the same two studies from Part A:
- Dr. Martinez: 50 patients per group
- Dr. Chen: 200 patients per group
Both construct 95% confidence intervals for the difference in improvement rates.
Question: Whose confidence interval will be wider?
Dr. Martinez’s CI will be wider.
Larger samples lead to smaller standard errors, which produce narrower confidence intervals. Dr. Chen’s larger study will give a more precise estimate of the true difference in improvement rates.
Part C: Effect Size and Strength of Evidence
Scenario: Two researchers study whether a new teaching method improves test scores compared to traditional instruction. Both have 100 students per group.
- Professor Adams: New method: 72% passed, Traditional: 68% passed (4 percentage point difference)
- Professor Baker: New method: 85% passed, Traditional: 65% passed (20 percentage point difference)
Question: Which professor’s study will provide stronger evidence against the null hypothesis?
Professor Baker’s study will provide stronger evidence (smaller p-value).
A larger observed difference (effect size) leads to a larger Z-score and thus a smaller p-value. Even with the same sample sizes, observing a 20 percentage point difference provides much stronger evidence against the null hypothesis than observing a 4 percentage point difference.
Part D: Confidence Level and CI Width
Scenario: A political poll of 500 likely voters finds that 52% support Candidate X in District A, compared to 47% in District B. The pollster wants to report a confidence interval for the difference in support between the two districts.
Question: If the pollster reports a 99% confidence interval instead of a 95% confidence interval, will the interval be wider or narrower?
The 99% CI will be wider.
Higher confidence requires a larger multiplier (\(z^*\)), which increases the margin of error. There’s a trade-off: if you want to be more confident that your interval captures the true value, you need a wider interval.
Part E: Proportions Near 50% vs. Extreme Proportions
Scenario: Two clinical trials compare treatment success rates between treatment and control groups, each with 150 patients per group.
- Trial 1: Treatment: 52% success, Control: 42% success (10 percentage point difference)
- Trial 2: Treatment: 92% success, Control: 82% success (10 percentage point difference)
Both trials observe the same 10 percentage point difference in success rates.
Question: Which trial will have stronger evidence (smaller p-value) against the null hypothesis?
Trial 2 will have a smaller p-value (stronger evidence).
Proportions near 50% create more variability (larger standard error) than proportions near 0% or 100%. Since Trial 1 has proportions closer to 50%, it has a larger SE, which leads to a smaller Z-score and larger p-value. Trial 2’s more extreme proportions result in less variability and stronger evidence for the same observed difference.
Part F: Confidence Level Trade-off
Scenario: A market researcher compares customer satisfaction rates between two store locations, surveying 200 customers at each location. She finds that 78% are satisfied at Location A compared to 71% at Location B.
She constructs both a 90% and a 99% confidence interval for the difference in satisfaction rates.
Questions:
- Which interval is more likely to contain the true difference?
- Which interval provides a more precise estimate?
The 99% CI is more likely to contain the true difference (99% vs 90% probability).
The 90% CI provides a more precise estimate because it is narrower.
This illustrates the fundamental trade-off: you can have higher confidence OR more precision, but not both (unless you increase the sample size).
References
- Introduction to Modern Statistics (2e) textbook by Mine Çetinkaya-Rundel and Johanna Hardin (Section 17.3).
- Anturane Reinfarction Trial Research Group. (1980). Sulfinpyrazone in the Prevention of Sudden Death after Myocardial Infarction. New England Journal of Medicine, 302(5), 250–256. Dataset available as
openintro::sulphinpyrazone.