Statistics and research

Mann–Whitney U test calculator

Wilcoxon rank-sum (Mann–Whitney U) test for two independent samples, exact for small samples without ties, with the rank-biserial effect size.

Runs in your browser. What you enter stays on this page and is not uploaded.

Separate values with spaces, commas, tabs or new lines (paste a spreadsheet column). Use a point for decimals.

Results

U (sample 1)35p-value0.2544Rank-biserial r0.4
U₁ = R₁ − n₁(n₁ + 1)/2 (R’s W)
35
U₂ = n₁n₂ − U₁
15
Smaller U
15
Method
Exact distribution (no ties, both samples under 50)
Hypothesis
two-sided
p-value
0.2544
Probability of superiority U₁ / (n₁n₂)
0.7
Conclusion
The distributions are not shown to differ (not significant at the 5% level).
Ranks
SamplenRank sumMean rank
Sample 110909
Sample 25306

A positive rank-biserial correlation means sample 1 tends to have the larger values.

Method and limits

How to use it

Paste the two independent samples. The test compares their distributions using ranks, so it suits small samples, ordinal scores and skewed data.

Formulas

  • Rank all n₁ + n₂ values together (ties get average ranks). U₁ = R₁ − n₁(n₁ + 1)/2, where R₁ is the rank sum of sample 1 (R reports this as W); U₂ = n₁n₂ − U₁.
  • Exact p-value from the permutation distribution of U when both samples have fewer than 50 values and there are no ties (as R).
  • Otherwise z = (U₁ − n₁n₂/2 ∓ 0.5) / σ with σ² = n₁n₂/12 × ((N + 1) − Σ(t³ − t)/(N(N − 1))), correcting for tied groups of size t.
  • Rank-biserial r = 2U₁/(n₁n₂) − 1; probability of superiority U₁/(n₁n₂) = P(X₁ > X₂) + ½P(X₁ = X₂).

Assumptions and limits

  • Independent observations within and between samples.
  • It tests whether one distribution tends to give larger values. It is a test of medians only if the two distributions have the same shape.
  • For paired data use the Wilcoxon signed-rank test.

Worked example

R’s wilcox.test example: samples of 10 and 5 values. W = U₁ = 35; the exact two-sided p = 0.2544 (one-sided p = 0.1272, as in R’s documentation); rank-biserial r = 0.40.

References

Related tools

Share this page

Remind me to visit Contifield

Adds a repeating reminder to your calendar, titled “Contifield Reminder: Visit www.contifield.com”.