Resources

How to calculate and justify sample size for your MD/MS thesis

Sample size is one of the first things a protocol review committee checks and one of the most common viva questions. A defensible sample size follows from your primary objective, uses inputs you can cite, and can be reproduced by anyone who reads your protocol.

Start from the primary objective

Primary objective Question type Formula
“To estimate the prevalence of anaemia in…” Estimating one proportion Single proportion (precision)
“To estimate mean serum vitamin D in…” Estimating one mean Single mean (precision)
“To compare mean pain scores between drug A and drug B” Comparing two means Two means (power)
“To compare cure rates with A and B” Comparing two proportions Two proportions (power)

Descriptive objectives are driven by precision: how narrow you want the confidence interval to be. Comparative objectives are driven by power: the chance of detecting a difference of a stated size if it truly exists. Using a precision formula for a comparative objective, or the reverse, is a frequent mistake.

The inputs you need

Input Symbol Usual choice or source
Significance level α 0.05 two-sided, so Z(1−α/2) = 1.96 (2.576 for 99%)
Power 1 − β 80%, Z(1−β) = 0.84; or 90%, Z(1−β) = 1.28
Expected proportion p A published study in a similar population
Standard deviation σ A published study or your own pilot
Precision d Absolute or relative, justified clinically
Clinically important difference Δ The smallest difference that would change practice
Expected dropout or non-response Experience in your setting or similar studies

The common formulas

Each formula gives a number that you round up to the next whole number.

Estimating a single proportion

n = Z² · p(1 − p) / d²

Z = Z(1−α/2), p is the expected proportion and d is the precision as a proportion (5 percentage points = 0.05).

Estimating a single mean

n = Z² · σ² / d²

σ is the expected standard deviation and d is the precision in the outcome’s units (for example, ±3 mmHg).

Comparing two means

n per group = 2 · (Z(1−α/2) + Z(1−β))² · σ² / Δ²

This assumes equal group sizes and a common SD. Δ is the difference in means you want to detect.

Comparing two proportions

n per group = [ Z(1−α/2) · √(2 · p̄(1 − p̄)) + Z(1−β) · √(p₁(1 − p₁) + p₂(1 − p₂)) ]² / (p₁ − p₂)²

where p̄ = (p₁ + p₂) / 2

p₁ and p₂ are the expected proportions in the two groups. Some textbooks use a simpler version, n = (Z(1−α/2) + Z(1−β))² · [p₁(1 − p₁) + p₂(1 − p₂)] / (p₁ − p₂)², which gives a slightly smaller number. Either is acceptable if you name the one you used.

Absolute versus relative precision

For a proportion, precision can be stated two ways:

  • Absolute: “within ±5 percentage points”. With p = 30%, d = 0.05, giving roughly 25% to 35%.
  • Relative: “within ±20% of the true value”. With p = 30%, d = 0.20 × 0.30 = 0.06, giving roughly 24% to 36%.

These give different sample sizes, so your protocol must say which you used. Relative precision matters most when p is small: ±5 percentage points on an expected prevalence of 4% is meaningless.

Adjusting for dropout and small populations

Divide by the proportion you expect to retain:

n adjusted = n / (1 − dropout rate)

With 20% dropout, divide by 0.8. Multiplying by 1.2 instead slightly undersizes the study: 36 / 0.8 = 45, but 36 × 1.2 = 43.2, which rounds up to 44.

If you sample from a small, known population (say, all 1,000 nurses in one hospital), the finite population correction reduces n:

n adjusted = n / (1 + (n − 1) / N)

N is the population size. It matters only when n is a sizeable fraction of N, and does not apply to an open outpatient population.

Worked examples (illustrative inputs only)

These inputs are hypothetical, chosen to show the arithmetic. In your protocol, every input must come from a reference study, a pilot or a stated clinical judgement.

Example 1: comparing two means

Suppose a reference study reported an SD of 12 mmHg for the fall in systolic blood pressure, and a difference of 8 mmHg between two drugs would be clinically important. With α = 0.05 (two-sided) and 80% power:

  • (1.96 + 0.84)² = 2.80² = 7.84
  • n per group = 2 × 7.84 × 12² / 8² = 2 × 7.84 × 144 / 64 = 35.28, rounded up to 36
  • With 10% dropout: 36 / 0.9 = 40 per group, 80 in total

Example 2: estimating a single proportion

Suppose a reference study in a similar population reported a prevalence of 30%. With 95% confidence:

  • Absolute precision ±5 percentage points: n = 1.96² × 0.30 × 0.70 / 0.05² = 3.8416 × 0.21 / 0.0025 = 322.7, rounded up to 323
  • Relative precision ±20% (d = 0.06): n = 3.8416 × 0.21 / 0.06² = 0.8067 / 0.0036 = 224.1, rounded up to 225
  • With 10% non-response on 323: 323 / 0.9 = 358.9, rounded up to 359
  • If the eligible population were only 1,000 people: 323 / (1 + 322 / 1000) = 244.3, rounded up to 245 (before non-response)

The same prevalence gives 323 or 225 depending on how precision is defined.

How to write it in your protocol

A reader should be able to repeat your calculation. Include:

  1. The primary objective and outcome the calculation is based on.
  2. The formula, or the software and the specific test option used.
  3. Every input: α, power, SD or proportion, precision or effect size.
  4. The source of each input, fully referenced (author, journal, year), with a sentence on why its population resembles yours.
  5. The dropout or non-response adjustment and why.
  6. The final number, per group where relevant.

Read the reference study yourself. Take the SD or proportion from its results for the relevant subgroup, not only its abstract, and check the outcome was measured the way you will measure it.

Tools

Software reduces arithmetic errors and handles designs the simple formulas do not:

  • G*Power: free desktop software for t-tests, ANOVA, correlation and some regression designs.
  • OpenEpi: free and browser-based, with modules for proportions, means and some epidemiological designs.
  • R, Stata, SPSS and similar packages: sample size functions for a wider range of designs.

Tools can differ slightly for the same inputs because of exact methods, continuity corrections or formula variants, so report the tool and option used. Software does not choose your inputs: a poorly chosen SD or effect size gives a poorly chosen sample size, however precisely calculated.

Common mistakes

  • Copying n from a paper. Another study’s n reflects its own objective and inputs. Use its results as inputs, not its n as your answer.
  • Confusing absolute and relative precision, or not stating which was used.
  • Convenience numbers presented as calculations. “All patients presenting over 18 months” can be a real feasibility limit, but it is not a justification. Calculate the precision or power that number gives you and state it honestly.
  • Objective and formula mismatch, such as a single-proportion formula for a study comparing two groups.
  • Calculating for a secondary outcome that happens to need fewer patients.
  • Effect sizes chosen for feasibility rather than clinical meaning.
  • Ignoring the design. Matched, paired, cluster and repeated-measures designs need other formulas.
  • Arithmetic slips, such as rounding down or forgetting to square d.

If your design goes beyond these standard cases, or you are unsure which input to trust, StatSure’s biostatisticians can work through the calculation with you and write it up in a form you can defend at protocol review and in the viva.

Chat on WhatsApp