Constructing a Confidence Interval for a Proportion
How to build a one-sample z-interval for a population proportion: define the parameter, check the three conditions, find the critical value, standard error and margin of error, and plan the sample size for a desired margin of error.
A single number like \(\hat{p} = 0.38\) is almost surely not exactly right. A confidence interval gives a range instead: the sample proportion, plus or minus a margin of error built from how much sample proportions vary. The procedure for one proportion is the one-sample z-interval, and it is only trustworthy when three conditions hold.
1What a confidence interval is
A confidence interval is an interval estimate for a population parameter. From a sample proportion, the one-sample z-interval estimates a single population proportion \(p\). Every interval has the same structure:
The parameter must be defined in context. It names three things: that it is a proportion, the response variable, and the population. “\(p\) = the proportion of all high school students in the state who used an AI tool for homework in the past week.”
“\(p\) = the proportion of the 400 students who used AI tools” describes the sample, which you already know exactly (0.38). The parameter is about the whole population: all high school students in the state.
2Conditions
A one-sample z-interval for a population proportion requires three conditions:
| Condition | Check | Why |
|---|---|---|
| Randomization | The data come from a random sample | So the sample represents the population |
| 10% condition | When sampling without replacement, \(n \le 0.10N\) | So observations are close to independent |
| Normality | Observed successes \(n\hat{p}\) and failures \(n(1-\hat{p})\) are both at least 10 | So the sampling distribution is approximately normal |
When building an interval, \(p\) is unknown, so the normality condition uses the observed counts: \(n\hat{p}\) and \(n(1-\hat{p})\), which are just the numbers of successes and failures in the sample (152 and 248).
A rare answer
A random sample of 60 students finds 4 who have broken a bone this year. Can a one-sample z-interval be used for the population proportion?
- 1Normality condition: \(n\hat{p} = 4\), which is less than 10.
- 2With so few successes, the sampling distribution of \(\hat{p}\) is not close to normal, and the interval’s true capture rate can fall well below the stated level.
3The calculation
The one-sample z-interval for a population proportion is
- The critical value \(z^*\) marks off the middle C% of the standard normal distribution, where C% is the confidence level.
- The standard error \(SE_{\hat{p}} = \sqrt{\hat{p}(1-\hat{p})/n}\) estimates the standard deviation of the sampling distribution of \(\hat{p}\): the typical amount a statistic varies from the parameter.
- The margin of error is \(z^* \times SE\): half the width of the interval.
| Confidence level | 90% | 95% | 99% |
|---|---|---|---|
| z* | 1.645 | 1.960 | 2.576 |
90% confidence
Find z* for a 90% confidence interval, and the 90% interval for the AI-tools data.
- 1The middle 90% leaves 5% in each tail, so z* has 95% of the area to its left: invNorm(0.95) ≈ 1.645.
- 2\(ME = 1.645(0.0243) \approx 0.040\).
- 3Interval: \(0.38 \pm 0.040 = (0.340,\ 0.420)\).
What each one measures
For the AI-tools sample, interpret the standard error 0.0243 and the margin of error 0.048.
- 1The standard error estimates the standard deviation of the sampling distribution of \(\hat{p}\): the typical amount a sample proportion varies from the population proportion.
- 2The margin of error is z* times the standard error, half the width of the interval.
4Start to finish
AI tools for homework
A random sample of 400 high school students in a state found that 152 had used an AI tool for homework in the past week. Construct a 95% confidence interval for the proportion of all high school students in the state who did so.
- 1State. \(p\) = the proportion of all high school students in the state who used an AI tool for homework in the past week. Confidence level 95%.
- 2Plan. One-sample z-interval for a population proportion. Randomization: a random sample. 10% condition: 400 is far less than 10% of all high school students in the state. Normality: \(n\hat{p} = 152\) and \(n(1-\hat{p}) = 248\), both at least 10.
- 3Do. \(\hat{p} = 152/400 = 0.38\). \(SE = \sqrt{0.38(0.62)/400} \approx 0.0243\). \(ME = 1.96(0.0243) \approx 0.048\). Interval: \(0.38 \pm 0.048 = (0.332,\ 0.428)\).
- 4Conclude. We are 95% confident that the interval from 0.332 to 0.428 captures the true proportion of all high school students in the state who used an AI tool for homework in the past week.
STAT, TESTS, 1-PropZInt. Enter x (the number of successes, 152), n (400), and the C-Level (0.95). The output (0.33243, 0.42757) matches the hand calculation. Show the formula and numbers too, so a reader can follow the work.
“We are 95% confident that the interval from 0.332 to 0.428 captures the true proportion of all high school students in the state who used an AI tool for homework in the past week.”
z* = 2 is a rough stand-in for 95% only. A 90% interval needs 1.645 and a 99% interval needs 2.576. Find z* from the confidence level each time.
5Choosing a sample size
Rearranging the margin of error gives the minimum sample size for a desired margin of error:
If there is no estimate of \(\hat{p}\) yet, use \(\hat{p} = 0.5\). That makes \(\hat{p}(1-\hat{p})\) as large as it can be, so the sample size is large enough whatever the true proportion turns out to be.
Margin of error at most 0.03
A researcher wants a 95% confidence interval for the proportion of students who use AI tools, with margin of error at most 0.03. How many students should be sampled (a) with no prior estimate, (b) using 0.38 as a prior estimate?
- 1Solve \(z^*\sqrt{\hat{p}(1-\hat{p})/n} \le ME\) for \(n\): \(n \ge \left(\dfrac{z^*}{ME}\right)^2 \hat{p}(1-\hat{p})\).
- 2(a) No estimate: use \(\hat{p} = 0.5\), which gives the largest possible \(n\). \(n \ge (1.96/0.03)^2(0.5)(0.5) \approx 1067.1\).
- 3(b) With 0.38: \(n \ge (1.96/0.03)^2(0.38)(0.62) \approx 1005.6\).
- 4Always round up, since rounding down would leave the margin of error slightly too large.
1067.1 rounds to 1,068, not 1,067. A sample of 1,067 gives a margin of error just over 0.03. Sample sizes always round up.
Quick reference
| Piece | Formula |
|---|---|
| Point estimate | \(\hat{p} = x/n\) |
| Standard error | \(SE = \sqrt{\hat{p}(1-\hat{p})/n}\) |
| Margin of error | \(ME = z^* \cdot SE\) |
| Interval | \(\hat{p} \pm z^* \sqrt{\hat{p}(1-\hat{p})/n}\) |
| Sample size | \(n \ge (z^*/ME)^2\, \hat{p}(1-\hat{p})\); use 0.5 if no estimate; round up |