Skip to content

Sample size and margin of error

5 min read

Short answer

Solve the margin of error formula for nn: n=(z∗σE)2n=\left(\dfrac{z^*\sigma}{E}\right)^2, rounding up. For a proportion, use n=z∗2 p(1−p)E2n=\dfrac{z^{*2}\,p(1-p)}{E^2}, with p=0.5p=0.5 as the safe worst case. Halving the margin needs four times the sample.

n = ( z* · σ / E )²n = ( z* · σ / E )²z* 1.96 for 95% confidenceσ spread of the data (guess or pilot)E margin of error you can acceptRound up never down: you need at least n
E sits in the denominator, squared: precision is expensive.

Polls and proportions

For a 95% poll with margin ±3\pm3 points, n=1.962(0.5)(0.5)0.032≈1068n=\dfrac{1.96^2(0.5)(0.5)}{0.03^2}\approx1068. Whether the population is 10 million or 300 million barely matters, because the margin depends on nn, not on the fraction sampled (unless the sample is a big share of a small population).

Where σ comes from

Use a pilot study, past data or a conservative estimate. If σ\sigma is underestimated, the real margin will end up larger than planned.

Worked example

How large a sample estimates a mean to within ±3\pm3 at 95% confidence if σ≈15\sigma\approx15?

n=(1.96⋅153)2=(9.8)2=96.04n=\left(\dfrac{1.96\cdot15}{3}\right)^2=(9.8)^2=96.04. Round up to n=97n=97 participants, since you need at least this many to guarantee the margin.

Try it yourself

With the same σ=15\sigma=15, what sample size gives ±1.5\pm1.5?

Show the answer

n=(1.96⋅151.5)2=19.62=384.16n=\left(\dfrac{1.96\cdot15}{1.5}\right)^2=19.6^2=384.16, so n=385n=385: four times as large as for ±3\pm3.

Keep going with practice

Vidi's central-limit-theorem lessons explain why the margin of error shrinks as one over the square root of n.