Mann-Whitney U Test Calculator

Statistics

Mann-Whitney U Test Calculator

Non-parametric test for comparing two independent samples. Robust to outliers and non-normal data.

Input Data

Results

U Statistic
12.0
n₁
5
n₂
6
U₁
12.0
U₂
18.0
R₁ (rank sum)
27.0
R₂ (rank sum)
39.0
Z-score
-0.5477
p-value (two-tailed)
0.371856
✗ Not significant at α = 0.05
No significant difference detected at 0.05 level.

What is the Mann-Whitney U Test?

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:

  • Non-parametric: Doesn't assume normal distribution; works with any shape.
  • Rank-based: Works with ordinal data or ranks, not raw values.
  • Robust to outliers: Extreme values don't distort results as much as in t-tests.
  • Small sample friendly: Performs well with small sample sizes.
  • No pooled variance assumption: Doesn't require equal variances between groups.

When to use instead of independent t-test: Non-normal data, small samples, ranked/ordinal data, presence of outliers, or unequal variances.

How to Perform Mann-Whitney U Test

1

Combine and rank all data

Pool all observations from both samples, sort them, and assign ranks (1 to n₁+n₂). Handle ties by averaging ranks.

2

Calculate rank sums R₁, R₂

Sum the ranks for sample 1 (R₁) and sample 2 (R₂) separately.

3

Compute U₁ and U₂

U₁ = R₁ − n₁(n₁+1)/2 and U₂ = R₂ − n₂(n₂+1)/2.

4

Select the test statistic U

Use U = min(U₁, U₂) for the two-tailed test.

5

Calculate z-score (for large samples)

z = (U − μᵤ) / σᵤ, where μᵤ = n₁n₂/2 and σᵤ = √[n₁n₂(n₁+n₂+1)/12].

6

Find p-value from standard normal distribution

Two-tailed p-value = 2 × P(Z ≥ |z|). Compare to α level (usually 0.05).

Example Calculation

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.

Frequently Asked Questions

Related Tools