Lesson 6 of 8 · 15 min

Margin of error and sample size

Calculate the margin of error E=zsnE = z\frac{s}{\sqrt{n}}, read xˉ\bar{x} and EE from an interval, see how nn and the confidence level change EE, and choose the sample size for a required precision.

What you will be able to do

  • Calculate the approximate margin of error E=zsnE = z\frac{s}{\sqrt{n}}.
  • Find xˉ\bar{x} and EE from the endpoints of an interval, and work back to ss.
  • Explain how the margin of error changes with sample size, confidence level and variability.
  • Find the smallest sample size that gives a required margin of error.

A confidence interval is "estimate plus or minus a margin": xˉ±E\bar{x} \pm E. The margin of error EE is how far the interval reaches on each side of xˉ\bar{x}, so it measures how precise the estimate is. A council planning a bus route cares whether the mean commute is known to within 3 minutes or within 30 seconds, and that is a question about EE.

Key idea

Approximate margin of error

E=zsnE = z\frac{s}{\sqrt{n}}

The interval is (xˉ−E,xˉ+E)(\bar{x} - E, \bar{x} + E). Its width is 2E2E.

Given an interval, you can work backwards. The sample mean is the midpoint and the margin of error is half the width:

xˉ=lower+upper2E=upper−lower2\bar{x} = \frac{\text{lower} + \text{upper}}{2} \qquad E = \frac{\text{upper} - \text{lower}}{2}

An approximate confidence interval for a population mean is (48.3,52.7)(48.3, 52.7). Find the sample mean xˉ\bar{x} and the margin of error EE.

Worked example

Working back from a confidence interval

  • Complex familiar

A clinic surveys a random sample of 6464 patients and reports an approximate 95% confidence interval of (12.4,14.0)(12.4, 14.0) minutes for the mean waiting time.

(a) Find the sample mean and the margin of error.

(b) Find the sample standard deviation ss, correct to 2 decimal places.

(c) Find the approximate 99% confidence interval from the same sample, correct to 2 decimal places.

4 steps

Try it yourself first, then check the working one step at a time.

Method

  1. xˉ\bar{x} is the midpoint and EE is half the width.

  2. Rearrange E=zsnE = z\frac{s}{\sqrt{n}} for the unknown.

  3. For a new confidence level, scale EE by the ratio of the zz values.

Watch out for

  • Using the full width 1.61.6 as the margin of error.

  • Forgetting 64=8\sqrt{64} = 8 when solving for ss.

Interactive

How the margin of error depends on n

The horizontal axis is the sample size nn. Trace the curve at n=25n = 25, 100100 and 400400: each time nn is multiplied by 4, EE halves. Then raise zz from 1.961.96 to 2.5762.576 (99%) and watch every margin grow.

How the parts of E=zsnE = z\frac{s}{\sqrt{n}} move the margin of error.
ChangeEffect on EEWhy
Larger sample nnSmallerE∝1nE \propto \frac{1}{\sqrt{n}}: four times the sample halves EE.
Higher confidence levelLargerA larger zz is needed to capture μ\mu more often.
More variable population (larger ss)LargerE∝sE \propto s.
Larger population (same nn)No changeThe population size is not in the formula.

A 95% confidence interval for a mean, from a sample of 100100, has margin of error 1.81.8. Roughly what sample size would give a 95% interval with margin of error 0.90.9?

Choose one answer

Before collecting data, you can choose nn to get the precision you need. Rearrange E=zsnE = z\frac{s}{\sqrt{n}} for nn, using an estimate of ss from a pilot study or past data:

n=(z sE)2n = \left(\frac{z\,s}{E}\right)^2

If the margin must be at most EE, take the next whole number up. Rounding down would give a margin slightly bigger than required.

Worked example

Choosing a sample size for a required margin of error

  • Simple familiar

A furniture company wants to estimate the mean time customers take to assemble its flat-pack desk. A pilot study suggests the standard deviation is about 3.23.2 minutes. How many customers should it time so that the margin of error is at most 0.50.5 minutes with (a) 95% confidence (b) 99% confidence?

5 steps

Try it yourself first, then check the working one step at a time.

Method

  1. Rearrange E=zsnE = z\frac{s}{\sqrt{n}} to n=(z sE)2n = \left(\frac{z\,s}{E}\right)^2.

  2. Use the pilot estimate of s.

  3. Always round up.

Watch out for

  • Rounding 157.35157.35 down to 157157.

  • Forgetting to square, giving n=13n = 13.

A pilot study suggests the standard deviation of a measurement is about 66 units. What is the smallest sample size that gives an approximate 95% confidence interval for the mean with a margin of error of at most 11 unit?

Common mistake

Rounding a sample size

Sample sizes always round up, even from 157.02157.02. A sample of 157 would not quite reach the required precision. And don't round zz, ss or n\sqrt{n} along the way: carry full accuracy until the final step.

Summary

  • The approximate margin of error is E=zsnE = z\frac{s}{\sqrt{n}}; the interval is xˉ±E\bar{x} \pm E.

  • From an interval: xˉ\bar{x} is the midpoint and EE is half the width.

  • Larger nn gives a smaller EE (four times the sample halves it); higher confidence or larger ss gives a larger EE.

  • For a margin of at most EE, n≥(z sE)2n \geq \left(\frac{z\,s}{E}\right)^2, rounded up.

Finished the lesson?

Try the 3 quick checks above and the lesson completes itself, or mark it complete now.

Lesson 6 of 80% read

Save your progress with a free account