Sample Size for Estimating a Mean
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
In words: Sample size = (z-value for the confidence level x standard deviation / margin of error)^2, rounded up
What each symbol means
| z | Number of standard errors for the confidence level (1.96 for 95%) | number |
| sigma | Standard deviation of the data (known or estimated) | same as data |
| E | Margin of error: the half-width of the interval you will accept | same 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-value | 1.960 | |
| n | 246 | |
| Years of monthly data | 246 ÷ 12 | 20.5 |
| n if the margin of error is halved | 984 |
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.