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.
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
- Number of pairs
- P(Dᵢ + Dⱼ > 0) for two independent within-pair changes
- Standard normal distribution function
- 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
Noether’s formula
The signed-rank statistic estimates the probability that the average of two changes is positive [1].
p from a difference and SD
For normal changes with SD σ_d.
Dropout
Applied last, to the participants actually recruited.
Parameters
P(Dᵢ + Dⱼ > 0)
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 pOptional
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 changesOptional
Values: Above 0
Given with the difference.
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
- 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
Open this example in the calculatorProtocol 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.
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 calculatorValidation
- 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.Noether GE. Sample size determination for some common nonparametric tests. Journal of the American Statistical Association. 1987;82(398):645–647.