letx=

Probability and statistics

Margin of error (proportion)

How far a poll's percentage could be from the true value at a given confidence level, and the sample size you need.

E=z∗p^(1−p^)n
Sample size neededn=(z∗)2p^(1−p^)E2
Confidence intervalp^±E

Calculator

The live calculator needs JavaScript. The worked example below shows the same steps it would.

See it move

500100015002000250030002%4%6%8%10%12%14%±3.1%
  • With n = 1000, the margin of error is ±3.1 percentage points.
  • Quadrupling the sample only halves the margin: E shrinks like 1/√n.

What the symbols mean

E
the margin of error, as a proportion (0.03 means ±3 percentage points)
z
the critical value z∗: 1.645 for 90% confidence, 1.96 for 95%, 2.576 for 99%
p^
the sample proportion p^ (use 0.5 when planning, which gives the largest margin)
n
the sample size

When to use it

Use it to read opinion polls ("52% ± 3%"), to plan how many people to survey for a target precision, and to build a confidence interval for a proportion. It assumes a simple random sample and a sample big enough that both np^ and n(1−p^) are at least about 10. When solving for n, round up.

Worked example

A poll of 1000 people finds 50% support a proposal. What is the margin of error at 95% confidence? (n = 1000, p̂ = 0.5, z* = 1.96)

  1. Start from the formula.

    E=z⁢p^·(1−p^)n
  2. Substitute z = 1.96, p^ = 0.5, n = 1000 and work it out.

    E=1.96⁢0.5·(1−0.5)1000
    =1.96⁢0.5·0.51000
    =1.96⁢0.251000
    =1.96⁢0.00025
    ≈1.96·0.0158114
    ≈0.0309903
  3. So the poll's result is 50% ± 3.1 percentage points: the interval 46.9% to 53.1%.

Answer E ≈ 0.031

Why it works

The sample proportion varies from sample to sample with standard error p^(1−p^)/n, and for large samples it is approximately normal, so about 95% of samples land within 1.96 standard errors of the true proportion.

Common mistakes

  • Thinking a bigger population needs a much bigger sample: the formula does not involve the population size.
  • Expecting double the sample to halve the margin; you need four times the sample, because of the square root.
  • Applying a poll's overall margin to small subgroups, which have their own, larger margins.