I have heard that Kruskal-Wallis test with two groups is equivalent to the Wilcoxon rank sum test, but I can't figure out how to prove it. Could someone please help me prove that under the condition $k=2$ test statistics are equal?

  • 2
    $\begingroup$ What have you tried? $\endgroup$
    – Galen
    Dec 4, 2022 at 18:32
  • $\begingroup$ @Galen I'm not sure how to do it. I think Kruskal-Wallis test statistic could be $\frac{12}{N(N+1)}( n_1(R_1-\frac{N+1}{2})^2 +n_2(R_2-\frac{N+1}{2})^2)$ but I dont know how to continue $\endgroup$
    – Lars
    Dec 4, 2022 at 18:54
  • 1
    $\begingroup$ Equivalence of tests does not imply the statistics are equal. It only means there is a one-to-one correspondence between the possible values of the test statistics. Thus, all you need to show is that (say) the sample size and the value of the Wilcoxon U statistic determine the KW statistic and vice versa. Intuitively, because the former is computed from the sum of ranks in one group (which determines the sum of ranks in the other group) and the latter is computed from the mean ranks in the groups, the correspondence amounts to that between a sum and a mean. $\endgroup$
    – whuber
    Dec 4, 2022 at 19:59
  • $\begingroup$ I agree with the spirit of what whuber was saying. Here is a footnote to it. In a usual sense of mathematical equivalence, any equality relation is an equivalence relation. There are various equivalences that are not equality but are also relevant because they are interesting or useful. $\endgroup$
    – Galen
    Dec 4, 2022 at 20:45

1 Answer 1


You can show that $H=\frac{(W_{n+m}-\mathbb{E}[W_{n+m}])^2}{Var_{H_0}(W_{n+m})}$, where H denotes the Kruskal-Wallis test statistic for k=2 and $W_{n+m}$ is the Wilcoxon-rank-sum test statistic.

The Kruskal-Wallis test statistic is given by


with $n=n_1+\dots+n_k$.

For k=2 we obtain


where $(\text{Var}_{H_0}(W_{n_1+n_2}))^{-1}=\frac{12}{(n_1+n_2)(n_1+n_2+1)}\frac{1}{n_1n_2}$.

Now we have $R_2=\frac{(n_1+n_2)(n_1+n_2+1)}{2}-R_1$ (*).This follows from the definition of the Wilcoxon-rank-sum test statistic. It is

$R_2=\frac{n_2(n_2+1)}{2}+\sum_{i=1}^{n_2}\sum_{j=1}^{n_1}\mathbf{1}_{(y_i\geq x_j)} \\ =\frac{n_2(n_2+1)}{2}+\sum_{i=1}^{n_2}\sum_{j=1}^{n_1}(1-\mathbf{1}_{(y_i\leq x_j)})\\= \frac{n_2(n_2+1)}{2}+n_1n_2+\sum_{i=1}^{n_2}\sum_{j=1}^{n_1}\mathbf{1}_{(y_i\leq x_j)}\\ = \frac{n_2(n_2+1)}{2}+n_1n_2+(R_1+\frac{n_1(n_1+1)}{2})\\ =\frac{(n_1+n_2)(n_1+n_2+1)}{2}-R_1.$

Substituting $R_2$ with (*) in the Kruskal-Wallis test statistic gives us


where $R_1=W_{n_1+n_2}$.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.