Calculators · §3
Form MS-C3
Before–after / within-subject · exact noncentral t

Sample size for a paired t-test

How many pairs you need when each participant is their own control — pre–post measurements, matched pairs, left–right comparisons.

Means calculations use the exact noncentral t distribution (Lenth 1989), so small samples are handled correctly. A planning estimate, not a substitute for a statistician.

Method & formula

The paired design tests the mean of the within-pair differences against zero, so the SD that belongs in the formula is the SD of the differences — not the SD of the raw measurements. This is the single most common error with paired calculations. If you only know the raw SD (σ) and the pre–post correlation (ρ), the SD of differences is σ_d = σ·√(2(1−ρ)); strong correlation is exactly why paired designs need fewer participants.

The calculation itself uses the exact noncentral t distribution on n−1 degrees of freedom, matching R's power.t.test(type = "paired").

Source: Lenth RV. Algorithm AS 243. Appl Statist 1989;38:185–89.

Inputs, explained

Meaningful mean difference
The smallest average change (after minus before, or between matched partners) that would matter clinically.
SD of the differences
The SD of the per-pair change scores. From pilot pre–post data, compute each participant's difference first, then take the SD of those.

A sample size is one line of a statistical plan. MedStatica turns a plain-language description of your study into the full plan — design, recommended analysis, power, causal diagram, methods paragraph, and runnable R, Python, SAS, and Stata code. The first plans are free, no card required.

Plan my study free →

Related calculators: comparing two means · one mean vs a reference value · Pearson correlation · all calculators