Mann-Whitney U Test Calculator
Non-parametric alternative to the independent samples t-test - no normality assumption required.
📖 What is the Mann-Whitney U Test?
The Mann-Whitney U test (also called the Wilcoxon rank-sum test) is a non-parametric statistical test that compares two independent groups to determine whether one group tends to have higher values than the other. Unlike the independent samples t-test, which compares means and requires normally distributed data, the Mann-Whitney test operates on ranks - making it valid for ordinal data, non-normal distributions, and small samples where the central limit theorem cannot be relied upon.
The test was developed by Henry Mann and Donald Whitney in 1947 as an extension of Frank Wilcoxon's 1945 rank-sum test. It addresses the question: given two groups, is one group stochastically larger than the other? More precisely, it tests whether P(X₁ > X₂) = 0.5 - whether a randomly chosen value from group 1 is equally likely to exceed a randomly chosen value from group 2. Under the null hypothesis, both groups come from the same distribution and U₁ ≈ n₁n₂/2.
The U statistic is computed by ranking all observations across both groups combined, computing the rank sum for each group, and deriving U from the formula U₁ = n₁n₂ + n₁(n₁+1)/2 − R₁. For large samples, the test uses a normal approximation: Z = (U − μ_U) / σ_U, with a tie correction to the variance. The rank-biserial correlation r = 1 − 2U_min/(n₁n₂) provides an interpretable effect size analogous to Cohen's d.
Common applications include comparing pain scores, quality of life ratings, satisfaction surveys, reaction times, income distributions, test scores, and any outcome measured on an ordinal or non-normal continuous scale. The test is standard in clinical trials for patient-reported outcomes, in psychology for Likert-scale data, and in ecology for comparing species counts across habitats.
📐 Formulas
U₂: U₂ = n₁n₂ − U₁ (note: U₁ + U₂ = n₁n₂)
Rank assignment: Combine both groups, sort ascending. Assign rank 1 to the smallest. Ties get the average rank.
Z-statistic (normal approximation with tie correction):
μ_U = n₁n₂/2
σ²_U = n₁n₂/12 × [(n+1) − ΣT/(n(n−1))] where T = Σtᵢ(tᵢ² − 1) for each tie group of size tᵢ
Z = (U_min − μ_U) / σ_U
p-value (two-tailed): p = 2 × Φ(Z), where Φ is the standard normal CDF.
Rank-biserial correlation (effect size): r = 1 − 2U_min / (n₁n₂)
Variables: R₁ = sum of ranks assigned to group 1 observations; n = n₁ + n₂ total observations.