Skip to main content

    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.

    Engine version 1.0.0 · Reviewed 1 October 2026

    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

    nn
    Participants per sequence (AB or BA)
    δ\delta
    Treatment difference to detect
    σw\sigma_w
    Within-participant standard deviation
    σ, ρw\sigma,\ \rho_w
    Total standard deviation and the correlation between a participant’s two measurements
    α\alpha
    Significance level: the chance of a false positive
    1−β1-\beta
    Power: the chance of detecting the effect if it is real
    τ\tau
    Number of tails: 2 for a two-sided test, 1 for one-sided
    qq
    Expected dropout

    Formulas

    Participants per sequence

    Pr⁡ ⁣(T2n−2,λ′>t2n−2, 1−α/τ)≥1−β,λ=δnσw\Pr\!\left(T'_{2n-2,\lambda} > t_{2n-2,\,1-\alpha/\tau}\right) \ge 1-\beta, \qquad \lambda = \frac{\delta\sqrt{n}}{\sigma_w}

    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

    σw=σ1−ρw\sigma_w = \sigma\sqrt{1 - \rho_w}

    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

    nrecruit=⌈n1−q⌉n_{\text{recruit}} = \left\lceil \frac{n}{1 - q} \right\rceil

    Applied last, to the participants actually recruited.

    Parameters

    Difference to detectδ\delta

    Values: Not zero

    The smallest treatment difference that would matter.

    Within-participant SDσw\sigma_wOptional

    Values: Above 0

    From a previous crossover, often reported as the residual SD; or give the next two instead.

    Total SDσ\sigmaOptional

    Values: Above 0

    The usual between-participant SD, with the correlation below.

    Correlation between periodsρw\rho_wOptional

    Values: Between −1 and 1

    How strongly a participant’s two measurements agree. The stronger it is, the more the crossover saves.

    Significance levelα\alpha

    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.

    Power1−β1-\beta

    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τ\tau

    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 dropoutqqOptional

    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

    Protocol 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.

    Open this example in the calculator

    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 calculator

    One-sided

    Testing one direction only: 13 per sequence.

    Sequence AB: 13 · Sequence BA: 13 · Total: 26

    Open this example in the calculator

    Allowing 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

    Protocol 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.

    Open this example in the calculator

    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. 1.Senn S. Cross-over Trials in Clinical Research. 2nd ed. Chichester: John Wiley & Sons; 2002.
    2. 2.Chow SC, Shao J, Wang H. Sample Size Calculations in Clinical Research. 2nd ed. Boca Raton: Chapman & Hall/CRC; 2008.