For a prevalence/proportion study, use:
[
n=\frac{Z^2 \times p \times q}{d^2}
]
Where:
- n = required sample size
- Z = Z value for confidence level
- 95% confidence: (Z=1.96)
- 90% confidence: (Z=1.645)
- 99% confidence: (Z=2.576)
- p = expected prevalence/proportion from your pilot study, in decimal form
- q = (1-p)
- d = allowable error/precision, in decimal form
This standard proportion formula is also described in this
sample-size overview.
Important: p is not the p-value
In this formula, p means prevalence/proportion, not the statistical p-value from a hypothesis test.
For example, if 40 of 200 pilot participants have the outcome:
[
p=\frac{40}{200}=0.20
]
[
q=1-0.20=0.80
]
Assume:
- 95% confidence: (Z=1.96)
- precision (d=0.05), meaning ±5%
Then:
[
n=\frac{(1.96)^2(0.20)(0.80)}{(0.05)^2}
]
[
n=\frac{3.8416 \times 0.16}{0.0025}
]
[
n=245.86
]
Round up:
[
\boxed{n=246}
]
If you expect 10% non-response/dropout:
[
n_{\text{final}}=\frac{246}{1-0.10}=273.3
]
[
\boxed{\text{Recruit 274 participants}}
]
If your pilot sample is 200
Use the pilot to calculate (p):
[
p=\frac{\text{number with outcome}}{200}
]
Examples:
| Pilot result | p | q | Required n at 95% CI, d = 5% |
|---|
| 20/200 have outcome | 0.10 | 0.90 | 138 |
| 40/200 have outcome | 0.20 | 0.80 | 246 |
| 100/200 have outcome | 0.50 | 0.50 | 385 |
| 160/200 have outcome | 0.80 | 0.20 | 246 |
The largest sample is needed when (p=0.50), because uncertainty is greatest.
If total population is only 200
If there are only 200 people in the whole population, first calculate (n_0) with the above formula, then apply the finite population correction:
[
n=\frac{n_0}{1+\frac{n_0-1}{N}}
]
Where:
- (n_0) = initial calculated sample size
- (N=200) = total population
For example, if (p=0.50), (d=0.05), then (n_0=384.16):
[
n=\frac{384.16}{1+\frac{384.16-1}{200}}
]
[
n=131.6
]
[
\boxed{n=132}
]
Give me:
- number with outcome in your pilot sample of 200,
- desired precision, such as 5% or 10%, and
- whether 200 is the pilot sample or the total population,
and I can calculate the exact final sample size.