Sample Size
Planning
Learn how to determine the right number of observations so your confidence interval hits a desired margin of error.
What Is Margin of Error?
When we estimate a population parameter (like a mean blood pressure), our estimate is never perfect. The margin of error tells us how far our estimate might be from the true value.
A smaller margin of error means a more precise estimate, but it requires more data. Sample size planning is the art of figuring out how much data you need.
Visualizing the Confidence Interval
Why Plan Your Sample Size?
The Sample Size Formula
For estimating a population mean with a known (or estimated) standard deviation \( \sigma \), the margin of error of a confidence interval is:
Solving for \( n \):
Always round up to the next whole number, because you cannot survey a fraction of a person.
Breaking Down Each Piece
Critical Values at a Glance
| Confidence Level | \( z^{*} \) | Effect on \( n \) |
|---|---|---|
| 90% | 1.645 | Smallest \( n \) |
| 95% | 1.960 | Moderate \( n \) |
| 99% | 2.576 | Largest \( n \) |
Margin of Error vs. Sample Size
How to Apply the Formula
Example 1: Blood Pressure Study
A researcher wants to estimate the mean systolic blood pressure of adults within \( E = 3 \) mmHg at 95% confidence. Prior studies suggest \( \sigma = 12 \) mmHg.
Example 2: Tighter Precision
Same study, but now the researcher wants \( E = 1.5 \) mmHg (half the previous margin). Everything else stays the same: \( z^{*} = 1.96 \), \( \sigma = 12 \).
Example 3: 99% Confidence
A hospital wants mean cholesterol within \( E = 5 \) mg/dL at 99% confidence. Pilot data gives \( \sigma = 30 \) mg/dL.
If 95% confidence were sufficient, \( z^{*} = 1.96 \) would give \( n = \lceil (1.96 \times 30 / 5)^{2} \rceil = \lceil 138.30 \rceil = 139 \). The jump from 95% to 99% increased \( n \) by about 72%.
How \( n \) Responds to Each Input
Sample Size for Proportions
When estimating a population proportion \( p \) (e.g., disease prevalence), the formula becomes:
If you have no prior estimate of \( p \), use the most conservative value: \( \hat{p} = 0.5 \), which maximizes \( \hat{p}(1 - \hat{p}) = 0.25 \).
Common Mistakes
Summary Cheat Sheet
| Parameter | Means | Proportions |
|---|---|---|
| Formula | \( n = \left(\frac{z^{*}\sigma}{E}\right)^{2} \) | \( n = \left(\frac{z^{*}}{E}\right)^{2}\hat{p}(1-\hat{p}) \) |
| Variability input | \( \sigma \) | \( \hat{p}(1-\hat{p}) \) |
| Conservative default | Use largest plausible \( \sigma \) | Use \( \hat{p} = 0.5 \) |
| Rounding rule | Always round up to the next integer | |
| Halving \( E \) does what? | Multiplies \( n \) by 4 | |
Question 1 of 5
A researcher needs a 95% CI for a mean with \( \sigma = 10 \) and desires \( E = 2 \). What is the minimum sample size?
Question 2 of 5
If you cut the desired margin of error in half while keeping confidence and \( \sigma \) constant, the required sample size:
Question 3 of 5
When computing sample size for a proportion with no prior estimate of \( p \), what conservative value should you use?
Question 4 of 5
A 99% CI requires \( z^{*} = 2.576 \). Compared to a 95% CI (same \( \sigma \) and \( E \)), the required sample size for 99% confidence is approximately:
Question 5 of 5
You compute \( n = 384.16 \) for a survey. What sample size should you actually use?