Skip to main content

    Method document

    Sample size for a Wilcoxon signed-rank test

    How many participants, or pairs, are needed for a rank-based test of paired measurements, planned on the probability that the average of two within-pair changes is positive. Covers one- or two-sided tests and dropout.

    Engine version 1.0.0 · Reviewed 2 October 2026

    https://statwisely.com/methods/nonparametric-signed-rank/

    When to use it

    • Before-and-after or matched measurements whose changes are skewed.

    Not for

    • Changes that are roughly normal: the paired t-test needs fewer pairs.

    Notation

    nn
    Number of pairs
    pp
    P(Dᵢ + Dⱼ > 0) for two independent within-pair changes
    Φ\Phi
    Standard normal distribution function
    α\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

    Noether’s formula

    n=⌈(z1−α/τ+z1−β)23 (p−12)2⌉n = \left\lceil \frac{(z_{1-\alpha/\tau} + z_{1-\beta})^{2}}{3\,(p - \tfrac{1}{2})^{2}} \right\rceil

    The signed-rank statistic estimates the probability that the average of two changes is positive [1].

    p from a difference and SD

    p=Φ ⁣(Δ2σd)p = \Phi\!\left(\frac{\Delta\sqrt{2}}{\sigma_d}\right)

    For normal changes with SD σ_d.

    Dropout

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

    Applied last, to the participants actually recruited.

    Parameters

    P(Dᵢ + Dⱼ > 0)pp

    Values: Between 0 and 1, not 0.5

    The chance that, for two pairs, the average of their changes is positive. 0.5 is no effect.

    Difference, instead of pΔ\DeltaOptional

    Values: Not zero

    With the SD, p is derived assuming normal data, so the parametric test’s cost can be shown alongside.

    SD of the changesσd\sigma_dOptional

    Values: Above 0

    Given with the difference.

    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

    • Participants are independent; the outcome is continuous, so ties are rare. Many ties make these approximations optimistic.
    • Noether’s formulas are large-sample approximations and slightly conservative: they ask for a few percent more than a simulated trial needs [1].
    • The changes are symmetric about their centre.
    • Dropout is unrelated to the outcome; recruiting more participants restores the numbers but cannot remove bias.

    Worked examples

    A probability of 0.65

    p = 0.65: n = 7.849 / (3 × 0.15²) = 116.3, so 117 pairs.

    Sample size: 117

    Protocol statement

    To detect a probability of 0.65 that the average of two within-pair changes is positive with 80% power at a two-sided significance level of 0.05, using a Wilcoxon signed-rank test, the required sample size is 117 pairs. Calculated with StatWisely (statwisely.com) using: n = [z_(1-α/2)+z_(1-β)]²/[3(p-½)²], p=P(Dᵢ+Dⱼ>0). These are planning estimates; confirm the final design with a qualified statistician.

    Open this example in the calculator

    From a standardised change of 0.5

    Mean change 0.5 with SD 1: p = Φ(0.5 × √2) = 0.760, so 39 pairs, against 34 for a paired t-test.

    Sample size: 39

    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 Wilcoxon signed-rank test. Method document, engine version 1.0.0, reviewed 2026-10-02. https://statwisely.com/methods/nonparametric-signed-rank/

    Cite the original references for the formulas your design uses as well.

    References

    1. 1.Noether GE. Sample size determination for some common nonparametric tests. Journal of the American Statistical Association. 1987;82(398):645–647.