Method document
Sample size for a Mann–Whitney test
How many participants are needed in each of two independent groups for a rank-based comparison, planned on the probability that a value from one group exceeds a value from the other. Covers unequal groups, one- or two-sided tests and dropout.
https://statwisely.com/methods/nonparametric-mann-whitney/
When to use it
- Two independent groups with a skewed or ordinal outcome, where a t-test’s normality cannot be assumed.
Not for
- Roughly normal outcomes, where the t-test needs about 5% fewer participants.
Notation
- Total participants
- Shares of participants in groups 1 and 2
- P(X > Y): chance a treated value exceeds a control value
- 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 Mann–Whitney statistic estimates p, which is ½ when the groups do not differ [1].
p from a difference and SD
For normal data with a common SD.
Dropout
Applied last, to the participants actually recruited.
Parameters
P(X > Y)
Values: Between 0 and 1, not 0.5
How often a randomly chosen treated participant does better than a randomly chosen control. 0.5 is no effect; 0.64 corresponds to a medium standardised 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.
Standard deviationOptional
Values: Above 0
Given with the difference.
Allocation ratioOptional
Values: Above 0; 1 for equal groups
The planned size of group 2 divided by group 1.
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].
- 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, α = 0.05 two-sided, 80% power: N = 7.849 / (12 × 0.25 × 0.15²) = 116.3, so 59 per group.
Group 1: 59 · Group 2: 59 · Total: 118
Open this example in the calculatorProtocol statement
To detect a probability of 0.65 that a treated value exceeds a control value with 80% power at a two-sided significance level of 0.05, using a Mann–Whitney test, the required sample size is 59 per group (118 in total). Calculated with StatWisely (statwisely.com) using: n = [z_(1-α/2)+z_(1-β)]²/[12c₁c₂(p-½)²], p=P(X>Y). These are planning estimates; confirm the final design with a qualified statistician.
From a standardised difference of 0.5
Difference 0.5, SD 1: p = Φ(0.5 / √2) = 0.638, so 69 per group, against 64 for a t-test.
Group 1: 69 · Group 2: 69 · Total: 138
Open this example in the calculatorTwice as many in group 2
With a 1 : 2 allocation: 44 and 88.
Group 1: 44 · Group 2: 88 · Total: 132
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 Mann–Whitney test. Method document, engine version 1.0.0, reviewed 2026-10-02. https://statwisely.com/methods/nonparametric-mann-whitney/
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.