Sample size for a margin of error
Choose n so that a confidence interval for a mean or proportion has at most a desired margin of error E, rounding up and optionally applying the finite population correction.
- planning value for the population SD (pilot study, past data)
- desired margin of error (half-width)
- normal quantile for the confidence level
- planning value for the proportion; 0.5 gives the largest
- population size
When to use
Planning a survey or study whose goal is a precise estimate. For detecting an effect with a test, plan for power instead (see errors and power and A/B sample size).
Assumptions
Simple random sampling; a sensible planning value for σ or ; the margin applies to the full sample (subgroups need their own ).
How to interpret
- Halving the margin quadruples .
- Round up to the next whole number; rounding down misses the target.
- Plan for nonresponse: divide by the expected response rate.
Common mistakes
- Rounding to the nearest integer.
- Using an optimistic σ, which yields too small a sample.
- Forgetting that the margin only covers sampling error, not bias.
Example
Mean with , , 95%: , so . Proportion with and : , so ; from a population of the FPC reduces this to .