Library / Statistics / STA-12
Statistics
Margin of error for a proportion
Uncertainty in a measured percentage or success rate.
- Ref
- STA-12
- Rev
- v1
- Field
- Statistics
- Result
- E
p is the proportion observed in the sample (0 to 1), n the sample size and z the critical value for the confidence level. The proportion is quoted as p ± E. E is largest at p = 0.5, so using p = 0.5 gives a safe worst-case margin.
Uncertainty in a measured percentage or success rate. It is largest when p is near 0.5.
Calculator
- Margin in percentage points4.9 %
- Sample size for ±1 percentage point at this p and z9,604
What drives the result
Each variable is moved across its typical range while the others stay at the values above. The longest bar is the key driver.
- With 400 trials and a 50 % hit rate the true rate is known only to about ±4.9 points; a rate of 50 % could really be anywhere from 45 % to 55 %.
- To tighten the margin to ±1 point at the default settings takes about 9,600 trials.
Chart data as tables
Ranked variables
| Variable | Typical range | Lowest result | Highest result | Swing () | Local step | Change in result |
|---|---|---|---|---|---|---|
| n Sample size | 5 to 100,000 | 0.003099 | 0.4383 | 0.4352 | +1 | −0.125 % |
| z Critical value (1.96 for 95 %) | 1 to 3.5 | 0.025 | 0.0875 | 0.0625 | +10% | +10 % |
| p Observed proportion | 0.01 to 0.99 | 0.009751 | 0.049 | 0.03925 | +10% | −0.501 % |
Sweep of Critical value (1.96 for 95 %)
| Critical value (1.96 for 95 %) | Margin of error |
|---|---|
| 1 | 0.025 |
| 1.313 | 0.03281 |
| 1.625 | 0.04063 |
| 1.938 | 0.04844 |
| 2.25 | 0.05625 |
| 2.563 | 0.06406 |
| 2.875 | 0.07188 |
| 3.188 | 0.07969 |
| 3.5 | 0.0875 |
Sweep one variable
Variables and how each one contributes
Margin of error
What the equation gives you. Everything else feeds it.
Critical value (1.96 for 95 %)
The critical value for the confidence level. Directly proportional: 99 % confidence (2.576) gives a margin 31 % wider than 95 % (1.96).
Observed proportion
The observed proportion or success rate. Largest margin at p = 0.5, narrowing towards 0 or 1; near the default it has almost no effect (a 10 % rise in p changes the margin by about 0.5 %).
Sample size
The number of trials in the sample. Inverse square root: four times as many trials halve the margin.
Worked example with the values above
- Variance of the proportion: p(1 − p)/n = 0.5 × 0.5 / 400 = 6.25×10−4.
- Standard error: √ = 0.025.
- E = 1.96 × 0.025 = 0.049 (4.9 percentage points).
Assumptions and limits
- Independent trials with the same chance of success.
- n large enough that np and n(1 − p) are both above about 10.
Common mistakes
- Quoting the margin in per cent when it is in fractions (0.049 is 4.9 points).
- Using the formula with p near 0 or 1 and a small sample, where it fails.
Statistics and uncertainty
The margin of error is largest at p = 0.5 and shrinks as 1/√n. It covers sampling error only, not bias in how the sample was chosen.
Where it is used
- Quoting a hit rate or pass rate from a limited number of trials.
- Planning how many trials are needed to prove a reliability claim.
Maths you need
- Proportions: a fraction of the total
- Confidence intervals: z σ/√n