Margin of Error

The margin of error is how far a sample estimate is likely to be from the true population value. It equals the critical value times the standard error: ME = z* · SE. For a proportion, that is z^*\sqrt{\hat{p}(1 - \hat{p})/n}. Solving this formula for n tells you how large a sample you need.

Before this lesson: Confidence Intervals and Confidence Interval for a Proportion

What the margin of error tells you

News polls often say something like “48%, with a margin of error of 3.5 points.” That means the 95% confidence interval runs from 44.5% to 51.5%. The margin of error is half the width of the interval.

It only covers random sampling error, the chance variation from one random sample to the next. It does not cover bias from a bad sample, such as people who refuse to answer or a misleading question (see sampling bias).

Three things control its size. A higher confidence level makes it bigger. More variability in the data makes it bigger. A larger sample makes it smaller, but slowly: you need 4 times the sample to cut it in half.

A decreasing curve of margin of error against sample size, for 95% confidence and p̂ = 0.5. The margin of error is about 0.098 at n = 100, 0.049 at n = 400 and 0.0245 at n = 1,600, with those three points marked.
Each time n is multiplied by 4, the margin of error is cut in half. Big samples bring diminishing returns.

Margin of error formulas

\text{ME} = z^* \sqrt{\dfrac{\hat{p}(1 - \hat{p})}{n}} \qquad \text{ME} = z^* \cdot \dfrac{\sigma}{\sqrt{n}}

The first formula is for a proportion. The second is for a mean when σ is known. Solving each one for n gives the sample size you need:

n = \left(\dfrac{z^*}{\text{ME}}\right)^2 p^*(1 - p^*) \qquad n = \left(\dfrac{z^* \sigma}{\text{ME}}\right)^2
  • p* is a guess for p, such as a value from an earlier study. With no guess, use p* = 0.5, which gives the largest possible n.
  • Always round n up to the next whole number, even if the decimal is small. Rounding down would give a margin of error slightly too large.

Calculator: type the whole formula in one line, such as (1.96/0.03)^2*0.25, so rounding along the way doesn’t change the answer.

Margin of error examples

Example 1: Find the margin of error

In a random sample of 900 adults, 45% say they exercise at least 3 times a week. Find the margin of error for a 95% confidence interval.

0.45(0.55) = 0.2475

Multiply p̂ by 1 − p̂.

\dfrac{0.2475}{900} = 0.000275

Divide by n.

\text{SE} = \sqrt{0.000275} \approx 0.0166

Take the square root (see square roots).

\text{ME} = 1.96(0.0166) \approx 0.0325

Multiply by z* = 1.96.

Answer: about 0.0325, or 3.25 percentage points. The 95% interval is about 0.45 ± 0.0325.

Example 2: Sample size with no prior estimate

A school board wants a 95% margin of error of 3 percentage points for the proportion of parents who favor a later start time. They have no estimate of p. How many parents should they survey?

n = \left(\dfrac{1.96}{0.03}\right)^2 (0.5)(0.5)

Use z* = 1.96, ME = 0.03 and p* = 0.5 (see literal equations for solving a formula for n).

\approx (65.333)^2 (0.5)(0.5)

Divide inside the parentheses.

= (65.333)^2 (0.25)

Multiply 0.5 by 0.5.

\approx 4268.4(0.25)

Square.

\approx 1067.1

Multiply.

n = 1068

Round up to the next whole number.

Answer: 1,068 parents. Rounding down to 1,067 would give a margin of error a little over 3 points.

Example 3: Sample size with a prior estimate

An earlier study found that about 20% of teens own a smartwatch. How many teens are needed for a 90% margin of error of 0.04?

n = \left(\dfrac{1.645}{0.04}\right)^2 (0.2)(0.8)

Use z* = 1.645, ME = 0.04 and p* = 0.2.

= (41.125)^2 (0.2)(0.8)

Divide inside the parentheses.

= (41.125)^2 (0.16)

Multiply 0.2 by 0.8.

\approx 1691.27(0.16)

Square.

\approx 270.6

Multiply.

n = 271

Round up.

Answer: 271 teens. Using p* = 0.5 instead would require 423, so a good prior estimate saves work.

Example 4: Sample size for a mean

Battery life of a phone model has standard deviation σ = 15 hours. How many phones are needed to estimate the mean battery life within 2 hours at 95% confidence?

n = \left(\dfrac{1.96(15)}{2}\right)^2

Use z* = 1.96, σ = 15 and ME = 2.

= \left(\dfrac{29.4}{2}\right)^2

Multiply 1.96 by 15.

= (14.7)^2

Divide by 2.

= 216.09

Square.

n = 217

Round up.

Answer: 217 phones.

Example 5: Is the race too close to call? (word problem)

A random poll of 800 likely voters finds 48% support Candidate A. Find the 95% margin of error, and decide whether the poll shows that Candidate A has less than majority support.

0.48(0.52) = 0.2496

Multiply p̂ by 1 − p̂.

\dfrac{0.2496}{800} = 0.000312

Divide by n.

\text{SE} = \sqrt{0.000312} \approx 0.0177

Take the square root.

\text{ME} = 1.96(0.0177) \approx 0.0347

Multiply by z* = 1.96.

0.48 - 0.0347 = 0.4453

Lower endpoint.

0.48 + 0.0347 = 0.5147

Upper endpoint.

Answer: the margin of error is about 3.5 points, and the interval is about (0.445, 0.515). Since 0.50 is inside the interval, the poll can’t rule out majority support. The race is too close to call.

Common mistakes

MistakeExample of the errorFix
Rounding the sample size downn = 1067.1, so survey 1,067Always round up: 1,068.
Forgetting to squaren = (1.96/0.03)(0.25)The ratio z*/ME is squared.
Using 50 instead of 0.5p*(1 − p*) = 50(50)Write proportions as decimals: 0.5(0.5) = 0.25.
Thinking ME covers all errors“Nonresponse is included in the ±3%”ME covers only random sampling error, not bias.
Thinking a bigger population needs a bigger sample“A national poll needs far more people than a state poll”n depends on ME, z* and p*, not on the population size.

Related methods

Margin of error for means

For a mean, σ is rarely known. Real intervals replace σ with the sample standard deviation s and z* with a t critical value, which the next lesson, t-Distribution, introduces. The sample-size formula above still gives a good planning estimate.

Margin of error in an interval

If you are given a confidence interval, the margin of error is half its width, and the estimate is its midpoint (see confidence intervals).

Practice problems

  1. A 95% interval uses SE = 0.02. Find the margin of error.
  2. A random sample of 600 gives p̂ = 0.6. Find the 95% margin of error.
  3. How large a sample gives a 95% margin of error of 0.05 with p* = 0.5?
  4. How large a sample gives a 99% margin of error of 0.02 with p* = 0.5?
  5. A prior study found p ≈ 0.1. How large a sample gives a 95% margin of error of 0.025?
  6. With σ = 8, how large a sample estimates μ within 1 unit at 90% confidence?
  7. The sample size grows from 400 to 1,600. What happens to the margin of error?
  8. Why do you use p* = 0.5 when you have no estimate of p?
  9. A confidence interval is (0.38, 0.46). Find the margin of error.
  10. A city council wants to estimate the share of residents who support a new park within 4 percentage points at 95% confidence. They have no estimate. How many residents should they survey?
Show answers

1.

\text{ME} = 1.96(0.02) = 0.0392

Multiply z* by SE.

Answer: 0.0392

2.

0.6(0.4) = 0.24

Multiply p̂ by 1 − p̂.

\dfrac{0.24}{600} = 0.0004

Divide by n.

\text{SE} = \sqrt{0.0004} = 0.02

Take the square root.

\text{ME} = 1.96(0.02) = 0.0392

Multiply by z*.

Answer: 0.0392

3.

n = \left(\dfrac{1.96}{0.05}\right)^2 (0.25)

Substitute; 0.5(0.5) = 0.25.

= (39.2)^2 (0.25)

Divide.

= 1536.64(0.25)

Square.

= 384.16

Multiply.

n = 385

Round up.

Answer: 385

4.

n = \left(\dfrac{2.576}{0.02}\right)^2 (0.25)

Substitute.

= (128.8)^2 (0.25)

Divide.

= 16589.44(0.25)

Square.

= 4147.36

Multiply.

n = 4148

Round up.

Answer: 4,148

5.

n = \left(\dfrac{1.96}{0.025}\right)^2 (0.1)(0.9)

Substitute.

= (78.4)^2 (0.1)(0.9)

Divide.

= (78.4)^2 (0.09)

Multiply 0.1 by 0.9.

= 6146.56(0.09)

Square.

\approx 553.19

Multiply.

n = 554

Round up.

Answer: 554

6.

n = \left(\dfrac{1.645(8)}{1}\right)^2

Substitute.

= (13.16)^2

Multiply.

\approx 173.19

Square.

n = 174

Round up.

Answer: 174

7.

\sqrt{1600} = 2\sqrt{400}

n is 4 times as large, so √n doubles.

Answer: the margin of error is cut in half

8.

p(1 − p) is largest when p = 0.5, where it equals 0.25. Using 0.5 gives a sample that is large enough for any true p.

Answer: it is the safest, most conservative choice

9.

\dfrac{0.46 - 0.38}{2} = \dfrac{0.08}{2}

Subtract the endpoints.

= 0.04

Divide by 2.

Answer: 0.04

10.

n = \left(\dfrac{1.96}{0.04}\right)^2 (0.25)

Substitute with p* = 0.5.

= (49)^2 (0.25)

Divide.

= 2401(0.25)

Square.

= 600.25

Multiply.

n = 601

Round up.

Answer: 601 residents

Margin of error FAQ

What is the formula for margin of error?

The margin of error is the critical value times the standard error. For a proportion, it is z^*\sqrt{\hat{p}(1 - \hat{p})/n}. For a mean with known σ, it is z^*\sigma/\sqrt{n}.

How do you find the sample size for a given margin of error?

For a proportion, use n = (z^*/\text{ME})^2 p^*(1 - p^*), with p* = 0.5 if you have no estimate. For a mean, use n = (z^*\sigma/\text{ME})^2. Always round up.

Does a larger sample always reduce the margin of error?

Yes, as long as the confidence level stays the same. But the margin of error shrinks with √n, so doubling the sample only cuts it by about 29%.

What does a margin of error of ±3% mean?

It means the 95% (or stated) confidence interval reaches 3 percentage points on each side of the sample result. It accounts for random sampling error only.

Summary

  • ME = z* · SE, and it is half the width of a confidence interval.
  • Higher confidence or more variability makes ME larger; a larger n makes it smaller.
  • Sample size for a proportion: n = (z^*/\text{ME})^2 p^*(1 - p^*), with p* = 0.5 if unknown.
  • Sample size for a mean: n = (z^*\sigma/\text{ME})^2.
  • Always round the sample size up.

Previous lesson: Confidence Interval for a Proportion

Next lesson: t-Distribution

Back to the Statistics Index