Margin of Error and Sample Size
AP Statistics · Unit 3 — Inference for Categorical Data: Proportions
What moves the margin of error
$$\text{ME}=z^*\sqrt{\frac{\hat p(1-\hat p)}{n}}$$- Higher confidence $\Rightarrow$ larger $z^*$ $\Rightarrow$ wider interval. Confidence and precision trade off; you cannot improve both without more data.
- Larger $n$ $\Rightarrow$ narrower, but only as $\frac{1}{\sqrt n}$.
- $\hat p$ near $0{,}5$ gives the widest interval, which is why $p=0{,}5$ is used when planning.
Choosing n in advance
Set $z^*\sqrt{\frac{p^*(1-p^*)}{n}}\le \text{ME}$ and solve for $n$, using $p^*=0{,}5$ if no prior estimate exists. Always round up — rounding down leaves the margin larger than required.
Worked example: computing the required sample size
You want to estimate a proportion with a maximum margin of error of $3\%$ at the $95\%$ confidence level, with no prior estimate. What sample size is needed?
Solution
Use $p^*=0.5$ (the worst case) and $z^*=1.96$:
$$1.96\sqrt{\frac{0.25}{n}}\le0.03$$$$\sqrt{\frac{0.25}{n}}\le\frac{0.03}{1.96}=0.015306$$$$\frac{0.25}{n}\le0.0002343\ \Longrightarrow\ n\ge1067.1$$Round up: $n=1068$.
This is why opinion polls often have sample sizes around $1000$–$1100$: it is just enough for a $3\%$ margin of error.