Skip to main content

Sample Size for Estimating a Mean

BeginnerData, Statistics & Computational SkillsAlso known as: quantitative foundations, margin of error, confidence interval width, how many observations

Finds: how many observations an estimate needs.

When to use it: Use it before collecting data, to know how many observations you need. To halve the margin of error you need four times the sample. Use an estimate of sigma from a pilot or from history. For small samples or unknown sigma the exact answer needs the t-distribution, so treat this as a good first estimate.

The formula

n\displaystyle n=(zα/2 σE)2\displaystyle =\left(\frac{z_{\alpha/2}\,\sigma}{E}\right)^{2}

In words: Sample size = (z-value for the confidence level x standard deviation / margin of error)^2, rounded up

What each symbol means

zNumber of standard errors for the confidence level (1.96 for 95%)number
sigmaStandard deviation of the data (known or estimated)same as data
EMargin of error: the half-width of the interval you will acceptsame as data

Worked example

Monthly returns have a standard deviation of 4%. You want to estimate the mean monthly return to within 0.5 percentage points with 95% confidence.

z-value1.960
n246
Years of monthly data246 ÷ 1220.5
n if the margin of error is halved984
The answer

The z-value is 1.960, so you need 246 monthly observations, about 20.5 years of data. Cutting the margin of error to 0.25 points would need 984 observations.

Want every formula on a few pages?Get the free Cheat Sheet (PDF) →

Calculator

z-value1.960
n246
n if the margin of error is halved984

Keep going