The Planning Phase
Sample size calculation is the single most important statistical step before launching a clinical trial. Too few participants and the study may fail to detect a real treatment benefit, wasting years of effort and millions of dollars. Too many participants and the study exposes unnecessary patients to unproven treatments and consumes resources that could fund other research. The calculation balances four quantities: significance level (α), power (1−β), effect size (d), and sample size (n) — knowing any three determines the fourth.
The Normal Distribution Visualization
The upper panel shows two overlapping normal distributions — the null hypothesis (no effect, centered at 0) and the alternative hypothesis (real effect, centered at d). The significance level α defines the rejection region in the tail of the null distribution. Power (1−β) is the area of the alternative distribution that falls in the rejection region. As you increase sample size, both distributions become narrower (standard error decreases), reducing their overlap and increasing power.
Effect Size: The Missing Ingredient
The most challenging aspect of sample size calculation is specifying the effect size. What difference between treatment and control is both clinically meaningful and realistic? This requires domain knowledge, pilot study data, or literature review. The simulation lets you explore how sensitive sample size is to effect size assumptions — halving the effect size quadruples the required sample. This nonlinear relationship catches many researchers off guard.
Beyond the Basics
This calculator covers the two-sample t-test scenario. Real clinical trials often require more complex calculations accounting for survival endpoints (requiring event-driven sample sizes), binary outcomes (requiring different formulas based on proportions), multiple comparisons (Bonferroni or other adjustments to α), adaptive designs (allowing sample size re-estimation at interim analyses), and dropout rates (inflating the sample to account for losses to follow-up).