b. Confidence Intervals
Yesterday (6a): the normal model gave us a math shortcut for hypothesis tests on a proportion.
Today: the same normal model gives us a math shortcut for confidence intervals.
Back in 4 we built a 95% CI by:
Because the bootstrap distribution was approximately normal and centered at \hat{p}, those 2.5th and 97.5th percentiles fall close to \hat{p} \pm 1.96 \cdot SE — and that’s the formula we’ll use today.
If the sampling distribution of \hat{p} is approximately normal, the confidence interval is:
\hat{p} \;\pm\; z^* \cdot SE
where:
Before using the normal model for a CI, check:
Independence — observations are independent (random sample, sample < 10% of population)
Success-failure — using \hat{p} this time:
Key difference from H-test: a CI plugs in \hat{p}; an H-test plugs in p_0. A CI has no null value to assume.
| Confidence level | z^* |
|---|---|
| 90% | 1.645 |
| 95% | 1.960 |
| 99% | 2.576 |
These come straight from the standard normal:
The Model-Based Inference calculator in Jamovi’s Randomize module gives you z^* for any confidence level (90%, 92%, 99%, …) — not just the three above. It also computes the CI and p-value directly.
Back in 4a: each \hat{p} is a dart, p is the bullseye. The CI is a circle around our dart, sized to catch the bullseye some fraction of the time.
The margin of error is the radius of that circle:
\text{margin of error} \;=\; z^* \cdot SE
So the CI is just \hat{p} \;\pm\; margin of error.
Whatever makes the radius bigger makes the CI wider — next slide names what controls it.
\hat{p} \;\pm\; \underbrace{z^* \cdot SE}_{\text{margin of error}} \;=\; \hat{p} \;\pm\; z^* \cdot \sqrt{\frac{\hat{p}(1-\hat{p})}{n}}
Three things change the margin of error — all visible in the formula:
| Change | Effect | Why |
|---|---|---|
| Confidence level goes up | wider | z^* gets bigger |
| Sample size goes up | narrower | SE gets smaller |
| \hat{p} closer to 0.5 | wider | \hat{p}(1-\hat{p}) gets bigger |
Topic 4b discovered these patterns by experiment with the bootstrap. Now you can read them straight off the formula.
From 6a: in a national random sample of n = 826 payday loan borrowers, 424 (51.3%) said they support additional regulation.
Yesterday’s H-test: H_0: p = 0.5 vs H_A: p > 0.5 → p-value = 0.222 → failed to reject H_0.
Today’s question: what range of values for p is plausible given our data? Build a 95% confidence interval.
Same data as 6a: n = 826, \hat{p} = 0.513.
Conditions:
Standard error (uses \hat{p}): SE = \sqrt{\dfrac{0.513 \times 0.487}{826}} = 0.0174
95% CI: 0.513 \;\pm\; 1.96 \times 0.0174 \;=\; (0.479,\; 0.547)
95% CI: (0.479,\; 0.547)
We are 95% confident that the true proportion of payday borrowers who support the regulation is between 47.9% and 54.7%.
Notice: the interval includes 0.5 — the null value from yesterday’s hypothesis test. That’s consistent with our H-test result (we failed to reject H_0: p = 0.5). Topic 7 will tighten this “consistent with” into a precise equivalence.
A campus survey of n = 400 randomly sampled university students asks whether they’ve used a generative-AI tool for a class assignment. 272 say yes (\hat{p} = 0.68). Conditions are met (272 ≥ 10 successes, 128 ≥ 10 failures).
Compute SE, then build the 95% CI. SE = \sqrt{\dfrac{0.68 \times 0.32}{400}} \approx 0.0233. 95% CI: 0.68 \pm 1.96 \times 0.0233 \approx (0.634,\; 0.726).
Interpret the 95% CI in plain English. We are 95% confident that the true proportion of university students who have used a generative-AI tool for a class assignment is between 63.4% and 72.6%.
Now build the 99% CI. (use z^* = 2.576) 0.68 \pm 2.576 \times 0.0233 \approx (0.620,\; 0.740) — wider, as the formula predicts.
Without computing, will the 90% CI be wider or narrower than the 95%? Why? Narrower. z^* drops from 1.96 to 1.645, so the margin of error shrinks. Less confidence required → smaller circle around our dart.
Blue bars = simulated sampling distribution. Red curve = normal approximation.
Left (n=100, p=0.5): success-failure passes (np = 50, n(1-p) = 50) — great fit.
Right (n=30, p=0.05): success-failure fails (np = 1.5 < 10) — true distribution is right-skewed, normal model misses it. That’s why we check the conditions.
For each scenario, you want a 95% CI for p. Which approach should you use — simulation or the normal model?
Random sample of n = 1{,}200 likely voters; \hat{p} = 0.52. Normal model. Observed successes \approx 624 and failures \approx 576 — both far above 10. Conditions met, so use the formula.
Pilot trial of n = 25 patients on a new pain medication; 5 report substantial relief (\hat{p} = 0.20). Simulation. Only 5 observed successes — fails success-failure. Use the bootstrap percentile CI from Topic 4.
Quality-control sample of n = 200 widgets; 3 are defective (\hat{p} = 0.015). Simulation. Only 3 observed successes — fails success-failure (rare events even at moderate n). Use the bootstrap percentile CI from Topic 4.
CI from the normal model: \;\hat{p} \pm z^* \cdot SE, with SE = \sqrt{\hat{p}(1-\hat{p})/n}.
Conditions to check:
When both conditions hold: simulation and the normal model give similar answers, and the formula is faster. Success-failure fails (independence OK): fall back on the bootstrap. Independence fails: both methods break down — the data themselves need a closer look.