Sample Size Calculation for Medical Research: A Practical Guide
Calculate sample size for prevalence studies and for comparing means or proportions, with formulas, worked examples and how to justify it in your synopsis.
Your sample size is one of the first things an ethics committee, guide or examiner checks. Too few participants and your study may miss a real effect; too many wastes time and exposes more people to research. A justified sample size has three parts: the right formula, values taken from a published source, and an allowance for non-response or drop-out.
What you need before you calculate
| Input | Meaning | Where it comes from |
|---|---|---|
| Primary objective | The one objective the sample size is based on | Your synopsis |
| Expected value | Prevalence, mean, SD or proportion in each group | A previous study or pilot data |
| Precision or effect size | How precise the estimate must be, or the smallest difference worth detecting | Clinical judgement and literature |
| Significance level (α) | Usually 5% (Z = 1.96 for two-sided tests) | Convention |
| Power (1 − β) | Usually 80% (Z = 0.84) or 90% (Z = 1.28) | Convention |
1. Estimating a proportion (prevalence)
For a descriptive cross-sectional study:
n = Z² × p × (1 − p) / d²
where p is the expected prevalence and d the absolute precision (margin of error).
Example: A previous study reported 30% prevalence. You want an absolute precision of 5% at 95% confidence.
n = 1.96² × 0.30 × 0.70 / 0.05² = 0.8067 / 0.0025 = 322.7 → 323
Adding 10% for non-response: 323 / 0.9 = 358.9, so 359 participants. More detail is in our cross-sectional sample size guide.
2. Comparing two means
For comparing a numerical outcome between two independent groups of equal size:
n per group = 2 × (Zα/2 + Zβ)² × σ² / Δ²
where σ is the standard deviation and Δ the smallest difference worth detecting.
Example: Systolic blood pressure has an SD of 10 mmHg. You want to detect a 5 mmHg difference with 80% power at α = 0.05.
n = 2 × (1.96 + 0.84)² × 10² / 5² = 2 × 7.84 × 100 / 25 = 62.7 → 63 per group
With 90% power, (1.96 + 1.28)² = 10.50, giving 83.98, so 84 per group.
3. Comparing two proportions
n per group = [Zα/2 × √(2p̄(1 − p̄)) + Zβ × √(p₁(1 − p₁) + p₂(1 − p₂))]² / (p₁ − p₂)²
where p̄ is the average of p₁ and p₂.
Example: Complications occur in 40% with the standard technique and you expect 20% with the new one (α = 0.05, power 80%). p̄ = 0.30.
Numerator = [1.96 × √0.42 + 0.84 × √0.40]² = [1.270 + 0.532]² = 3.25
n = 3.25 / 0.04 = 81.2 → 82 per group
Software that helps
You do not need to calculate by hand. Free tools such as OpenEpi and G*Power, as well as most statistical packages, compute these numbers. Always record the inputs you used, because your synopsis must show them.
How to write it in your synopsis
The sample size was calculated using the formula n = Z²p(1 − p)/d², taking the prevalence of anaemia as 30% from [reference], an absolute precision of 5% and 95% confidence. The minimum sample size was 323. Allowing for 10% non-response, 359 participants will be included.
Common mistakes
- No reference for the expected prevalence, mean or SD.
- Using the prevalence formula for a comparative study.
- Calculating for one group when the formula gives the number per group.
- Forgetting the non-response or drop-out allowance.
- Calculating the sample size after collecting data to justify the number you already have.
Key takeaways
- Base the sample size on your primary objective.
- Use the formula that matches the design: proportion, two means or two proportions.
- Take inputs from published studies and cite them.
- Round up, add a non-response allowance and write the calculation in full.
References
- Charan J, Biswas T. How to calculate sample size for different study designs in medical research? Indian J Psychol Med. 2013;35(2):121–126. PubMed
- Lwanga SK, Lemeshow S. Sample Size Determination in Health Studies: A Practical Manual. Geneva: World Health Organization; 1991.
- Dean AG, Sullivan KM, Soe MM. OpenEpi: Open Source Epidemiologic Statistics for Public Health. openepi.com
- Kirkwood BR, Sterne JAC. Essential Medical Statistics. 2nd ed. Oxford: Blackwell Science; 2003.
This article is for education. Always follow the requirements of your university, guide, ethics committee and target journal.