Mann-Whitney U Test Calculator

Compare two groups without assuming normality, or run the Wilcoxon signed-rank test on paired data.

The Mann-Whitney U test (Wilcoxon rank-sum test) compares two independent groups by ranking all values together. U = R₁ − n₁(n₁ + 1)/2, where R₁ is the rank sum of group 1. With no ties and fewer than 50 values per group the p-value is exact; otherwise a normal approximation with tie and continuity correction is used. For paired measurements the Wilcoxon signed-rank test ranks the absolute differences instead.

Free, runs in your browser. Nothing you enter is uploaded.

Formula

U₁ = R₁ − n₁(n₁ + 1)/2,   z = (U₁ − n₁n₂/2 ∓ 0.5) / √{(n₁n₂/12)[(N + 1) − Σ(t³ − t)/(N(N − 1))]},   r = |z| / √N

Under the null hypothesis U has mean n₁n₂/2. The variance shrinks when values are tied, which the Σ(t³ − t) term corrects for, and 0.5 is a continuity correction toward the mean. The exact p-value counts every possible rank arrangement. The signed-rank test uses W+, the sum of ranks of positive differences, with mean n(n + 1)/4 and variance n(n + 1)(2n + 1)/24 minus Σ(t³ − t)/48 for ties. Zero differences are dropped.

Questions

When should I use the Mann-Whitney U test instead of a t-test?

Use it for ordinal data such as scores or ratings, and for small samples that are clearly skewed or contain extreme values. With roughly normal data the t-test has slightly more power.

How do I report a Mann-Whitney U test?

Give the medians of both groups, U, z (for larger samples), the p-value and an effect size. For example: Group B scored higher (median 16.5 vs 13.3), U = 9, z = −3.61, exact p < 0.001, r = 0.74.

Exact or asymptotic p-value: which one is used?

The exact p-value is used when there are no tied values and both groups have fewer than 50 observations, the same rule R uses. Otherwise the normal approximation with tie and continuity correction is reported. The result table states which one you are reading.

What is the effect size r for Mann-Whitney?

r = |z| / √N, where N is the total sample size. Around 0.1 is small, 0.3 medium and 0.5 large. The rank-biserial correlation is also shown and runs from −1 to 1.

What is the Wilcoxon signed-rank test used for?

Paired or repeated measurements on the same subjects, such as before and after treatment, when the differences are not normally distributed. It is the non-parametric alternative to the paired t-test.

References

More Statistics

All free tools · By Dr. Zubair Khalid, DVM, MS, PhD.