Sample Size for Estimating a Mean

Finds how many observations are needed to estimate a population mean to a given precision. The sample size is (critical value z × standard deviation ÷ margin of error)². Halving the margin of error needs four times as many observations.

Before a study starts, someone has to decide how much data to gather. Too little and no conclusion emerges; too much and the effort is wasted. Fix the precision you need and the number follows.

The half-width of a confidence interval for a mean is the critical value times the standard deviation divided by n\sqrt{n}. Setting that no larger than the margin of error and solving for nn gives this.

n=(zσE)2n = \left(\dfrac{z \sigma}{E}\right)^{2}

Any fraction is rounded up, since rounding down would leave the target precision just out of reach.

The key feature is that EE sits in the denominator and is squared. Halving the margin of error quadruples the sample needed. Precision is more expensive than it looks.

Example

Take the defaults: a population standard deviation of 15, a margin of error of 2, and 95% confidence.

The critical value at 95% is about 1.9600. Then 1.96×15÷21.96 \times 15 \div 2 is 14.7, and squaring gives 216.09. Rounded up, the required sample size is 217.

Collecting exactly 217 gives a margin of 1.96×15÷2171.96 \times 15 \div \sqrt{217}, about 1.9958, comfortably inside the target of 2.

Tighten the margin to 1 and the requirement jumps to 865. There, in figures, is the four-fold cost of halving the error.

When the standard deviation is unknown

The formula needs a population standard deviation, which is almost never known before the study. In practice it comes from a pilot study, or is borrowed from earlier work on similar data.

With nothing at all to go on, one rough guide is the expected range divided by 4, since a normal distribution keeps almost all of its values within two standard deviations either side of the mean, a span of four standard deviations in total.

Points to watch

For a small population this formula asks for too much. If the answer exceeds about 5% of the population, apply a finite population correction to bring it down.

The number produced is the number of usable responses. The number of questionnaires to send out must be larger, scaled up by the expected response rate.