Method document
Sample size for a 2 × 2 crossover trial
How many participants are needed in each sequence of an AB/BA crossover trial, in which everyone receives both treatments in a random order and serves as their own control. Covers one- or two-sided tests and dropout.
https://statwisely.com/methods/crossover/
When to use it
- A stable, chronic condition, with treatments whose effects wear off completely between periods.
Not for
- Conditions that change or resolve over the study, or treatments with lasting effects (carryover).
- Outcomes such as death or cure, which cannot be measured twice.
Notation
- Participants per sequence (AB or BA)
- Treatment difference to detect
- Within-participant standard deviation
- Total standard deviation and the correlation between a participant’s two measurements
- Significance level: the chance of a false positive
- Power: the chance of detecting the effect if it is real
- Number of tails: 2 for a two-sided test, 1 for one-sided
- Expected dropout
Formulas
Participants per sequence
The treatment effect is estimated from within-person differences, so between-person variation cancels and only the within-person SD remains; the period effect cancels because half the participants take each order [1, 2].
Within-participant SD from the total SD
When only the usual SD and the correlation between repeated measurements are known. The calculator then also reports the parallel-group trial that would answer the same question.
Dropout
Applied last, to the participants actually recruited.
Parameters
Difference to detect
Values: Not zero
The smallest treatment difference that would matter.
Within-participant SDOptional
Values: Above 0
From a previous crossover, often reported as the residual SD; or give the next two instead.
Total SDOptional
Values: Above 0
The usual between-participant SD, with the correlation below.
Correlation between periodsOptional
Values: Between −1 and 1
How strongly a participant’s two measurements agree. The stronger it is, the more the crossover saves.
Significance level
Values: Between 0 and 1; usually 0.05
The false-positive rate you accept. A smaller α, for example to allow for several primary outcomes, needs a larger sample.
Power
Values: Between 0 and 1; usually 0.80 or 0.90
The chance of a significant result if the assumed effect is real. Funders and ethics committees commonly expect at least 0.80.
One- or two-sided
Values: 2 (two-sided) or 1 (one-sided)
Two-sided is the default. A one-sided test is justified only when an effect in the other direction would be treated exactly as no effect, and should be stated in advance.
Expected dropoutOptional
Values: 0% up to, but not including, 100%
The share of participants expected to provide no outcome, from comparable studies. Recruiting more restores the numbers, not the comparability of the groups: if dropout is related to the outcome, the estimate can still be biased.
Assumptions
- No carryover: the first treatment is fully washed out before the second period.
- The within-participant differences are roughly normal, with the same SD in both sequences.
- Participants who drop out after one period contribute nothing, so dropout counts whole participants.
- Dropout is unrelated to the outcome; recruiting more participants restores the numbers but cannot remove bias.
Worked examples
A within-participant SD of 7
Difference 5, σ_w = 7, α = 0.05 two-sided, 80% power: 17 per sequence, 34 participants in total.
Sequence AB: 17 · Sequence BA: 17 · Total: 34
Open this example in the calculatorProtocol statement
To detect a treatment difference of 5 with 80% power at a two-sided significance level of 0.05, using a 2 × 2 crossover trial, and assuming a within-participant standard deviation of 7 and no carryover between periods, the required sample size is 17 per sequence (34 in total). Calculated with StatWisely (statwisely.com) using: n per sequence: solve noncentral-t power for δ/σ_w on 2n-2 df; Var(δ̂)=σ_w²/n. These are planning estimates; confirm the final design with a qualified statistician.
Against a parallel trial
Total SD 10 with a correlation of 0.5: σ_w = 10 × √0.5 = 7.07, so 17 per sequence, 34 in total. The same question as a parallel trial needs 128.
Sequence AB: 17 · Sequence BA: 17 · Total: 34
Open this example in the calculatorOne-sided
Testing one direction only: 13 per sequence.
Sequence AB: 13 · Sequence BA: 13 · Total: 26
Open this example in the calculatorAllowing for dropout
Expecting 15% not to complete both periods: 17 / 0.85 = 20, so 20 per sequence.
Sequence AB: 17 · Sequence BA: 17 · Total: 34 · To recruit: 20 and 20
Open this example in the calculatorProtocol statement
To detect a treatment difference of 5 with 80% power at a two-sided significance level of 0.05, using a 2 × 2 crossover trial, and assuming a within-participant standard deviation of 7 and no carryover between periods, the required sample size is 17 per sequence (34 in total). Allowing for 15% dropout, 20 per sequence (40 in total) should be recruited. Calculated with StatWisely (statwisely.com) using: n per sequence: solve noncentral-t power for δ/σ_w on 2n-2 df; Var(δ̂)=σ_w²/n. These are planning estimates; confirm the final design with a qualified statistician.
Validation
- Every worked example on this page is recomputed by the StatWisely engine whenever the software is built. If a number or formula here stopped matching the calculator, the release would be stopped until this document was corrected.
- An independent implementation in R recomputes this test every night and before each production release, and the results are compared with the engine’s.
How to cite
StatWisely. Sample size for a 2 × 2 crossover trial. Method document, engine version 1.0.0, reviewed 2026-10-01. https://statwisely.com/methods/crossover/
Cite the original references for the formulas your design uses as well.
References
- 1.Senn S. Cross-over Trials in Clinical Research. 2nd ed. Chichester: John Wiley & Sons; 2002.
- 2.Chow SC, Shao J, Wang H. Sample Size Calculations in Clinical Research. 2nd ed. Boca Raton: Chapman & Hall/CRC; 2008.