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.