01 / 21
\(n\)

Sample Size
Planning

Learn how to determine the right number of observations so your confidence interval hits a desired margin of error.

Biostatistics

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

Point Estimate Lower Bound Upper Bound \(E\) \(E\)

Why Plan Your Sample Size?

★ Precision
Too few subjects produce wide, uninformative intervals that cannot guide decisions.
★ Ethics
Enrolling more participants than needed wastes time, money, and exposes people to unnecessary risk.
★ Funding
Grant reviewers and IRBs require a justified sample size before approving any study.

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

\( z^{*} \)
The critical value from the standard normal distribution, determined by your confidence level (e.g., 1.96 for 95%).
\( \sigma \)
The population standard deviation. Often estimated from a pilot study or prior literature. The \(z\)-distribution is used as a robust approximation for planning.
\( E \)
The desired margin of error: how close you want your estimate to be to the true mean.

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

Margin of Error (E) Sample Size (n) n=50 n=200 0 5 10 Diminishing returns: quadrupling n only halves the ME

How to Apply the Formula

1
Choose your confidence level. This determines \( z^{*} \) (e.g., 95% gives 1.96).
2
Estimate \( \sigma \). Use a pilot study, prior research, or a reasonable guess.
3
Set your desired margin of error \( E \). How precise does your estimate need to be?
4
Plug in and solve: \( n = \left(\frac{z^{*} \cdot \sigma}{E}\right)^{2} \).
5
Round up to the next whole number. Always round up, never down.

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

62 107 Raise confidence 95% to 99% 62 246 Double sigma 12 to 24 62 246 Halve E 3 to 1.5 baseline

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

✕ Rounding Down
Getting \( n = 61.47 \) and rounding to 61 gives a margin of error larger than desired. Always round up.
✕ Forgetting to Square
Computing \( n = \frac{z^{*} \cdot \sigma}{E} \) without squaring the result gives a number far too small.
✕ Wrong \( \sigma \)
Using the sample standard deviation \( s \) from a tiny pilot as if it were exact. Recognize this is an estimate.

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?