Non-parametric test for comparing two independent samples. Robust to outliers and non-normal data.
The Mann-Whitney U test is a non-parametric statistical test that compares two independent samples. It determines whether the distributions of the two groups differ significantly.
Hypothesis: H₀: The two distributions are equal | H₁: The distributions differ
Key Advantages:
When to use instead of independent t-test: Non-normal data, small samples, ranked/ordinal data, presence of outliers, or unequal variances.
Pool all observations from both samples, sort them, and assign ranks (1 to n₁+n₂). Handle ties by averaging ranks.
Sum the ranks for sample 1 (R₁) and sample 2 (R₂) separately.
U₁ = R₁ − n₁(n₁+1)/2 and U₂ = R₂ − n₂(n₂+1)/2.
Use U = min(U₁, U₂) for the two-tailed test.
z = (U − μᵤ) / σᵤ, where μᵤ = n₁n₂/2 and σᵤ = √[n₁n₂(n₁+n₂+1)/12].
Two-tailed p-value = 2 × P(Z ≥ |z|). Compare to α level (usually 0.05).
Sample 1: 12, 15, 18, 22, 25 (n₁=5) Sample 2: 10, 14, 19, 24, 30, 35 (n₂=6) Combined & sorted: 10, 12, 14, 15, 18, 19, 22, 24, 25, 30, 35 Ranks: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 R₁ = 2 + 4 + 5 + 7 + 9 = 27 R₂ = 1 + 3 + 6 + 8 + 10 + 11 = 39 U₁ = 27 − (5×6)/2 = 27 − 15 = 12 U₂ = 39 − (6×7)/2 = 39 − 21 = 18 U = min(12, 18) = 12 μᵤ = (5×6)/2 = 15 σᵤ = √[(5×6×12)/12] = √30 ≈ 5.48 z = (12 − 15) / 5.48 ≈ −0.547 Two-tailed p-value ≈ 0.584 (not significant at α=0.05) Conclusion: No significant difference between the two samples.
Related Tools