How to use it
- Paste the values of the first group into Sample 1 and the second group into Sample 2.
- Choose two-tailed unless you decided on a direction before seeing the data.
- Read U, the p-value and whether it is below your significance level.
How the test works
All values are ranked together from smallest to largest; tied values share the average of their ranks. With R₁ the rank sum of sample 1:
- U₁ = R₁ − n₁(n₁ + 1)/2 and U₂ = n₁n₂ − U₁. U₁ counts the pairs in which the value from sample 1 is larger (ties count ½).
- Normal approximation: mean μ = n₁n₂/2, variance σ² = n₁n₂/12 × ((N + 1) − Σ(t³ − t)/(N(N − 1))), where t is the size of each group of ties. z = (U₁ − μ ∓ ½)/σ with the continuity correction.
- Exact p-value: with no ties and samples of at most 49, the calculator counts how many of the C(N, n₁) equally likely rank arrangements give a U as extreme as yours.
- Effect size: rank-biserial correlation = (U₁ − U₂)/(n₁n₂), from −1 to 1; U₁/(n₁n₂) is the probability that a random value from sample 1 is larger than one from sample 2.
Worked example
Sample 1: 12, 15, 11, 18, 14, 16, 13. Sample 2: 19, 17, 22, 16, 21, 20.
Ranked together, sample 1 gets ranks 1, 2, 3, 4, 5, 6.5 and 9 (the two 16s share 6.5), so R₁ = 30.5 and U₁ = 30.5 − 7 × 8/2 = 2.5; U₂ = 42 − 2.5 = 39.5. Because of the tie the normal approximation is used: μ = 21, σ² = 42/12 × (14 − 6/156) = 48.87, σ = 6.99, z = (2.5 − 21 + 0.5)/6.99 = −2.57, two-tailed p = 0.010. At α = 0.05 the difference is significant.
Tips and common mistakes
- The two samples must be independent. For before-and-after measurements on the same people, use the Wilcoxon signed-rank test.
- Many ties weaken the test; heavily rounded data or short rating scales are common causes.
- A non-significant result does not show the groups are the same, only that the data do not show a difference.