Advertisement

Wilcoxon rank-sum test calculator

Compare ordered responses in independent groups. Positive z favours larger values in group 1.

Calculator

Group 1 U
0.000000
Group 2 U
9.000000
Group 1 raw rank sum W
6.000000
Tie-corrected normal z (approximation)
-1.745743
P-value
10.0000000000%
P-value method used
Exact permutation distribution (no ties)
Decision
Do not reject the null hypothesis
Pooled ascending ranks
GroupValueAverage rank
1.0000001.0000001.000000
1.0000002.0000002.000000
1.0000003.0000003.000000
2.0000004.0000004.000000
2.0000005.0000005.000000
2.0000006.0000006.000000

Advertisement

How this calculator works

Wilcoxon rank-sum inference pools both groups and adds the ranks belonging to group 1. The raw rank sum shown here differs from software that labels a shifted U statistic W. The equivalent U and raw rank sum are both reported. Small untied samples use an exact subset distribution. Otherwise the normal approximation corrects its variance for tied ranks and optionally adjusts the statistic by 0.5. This tests distributional agreement; a pure median-shift interpretation requires comparable distribution shapes. It is not a paired signed-rank test.

Formula

U1 = W1 - n1(n1 + 1)/2; U2 = n1n2 - U1. E(U1) = n1n2/2. Var(U1) = n1n2[(N + 1) - Σ(t³ - t)/(N(N - 1))]/12. Two-sided exact p = min(1, 2 × smaller inclusive tail).

Worked example

Group 1 = 1, 2, 3 and group 2 = 4, 5, 6 give raw rank sum 6, U1 = 0 and U2 = 9. Of the 20 equally likely rank assignments, one is this extreme in each direction, giving two-sided exact p = 0.1.

Advertisement

Frequently asked questions

How are ties ranked?

Every value in a tied block receives its average pooled rank. Exact mode here requires no ties; normal mode uses tie-corrected variance.

Does the test compare medians?

A location interpretation needs similarly shaped distributions. In general the test can detect other distributional differences.

How do W and U differ?

Raw W adds the group 1 ranks; subtract n1(n1 + 1)/2 to get U1. Some programs call this shifted statistic W, so check their convention.

Sources

Advertisement