# Why are there two forms for the Mann-Whitney U test statistic?

I have encountered two forms for calculating the two-sample Mann-Whitney U test statistic, which are:

$$U_1 = R_1 - \frac{n_1(n_1 + 1)}{2}$$

and

$$U_1 = n_1n_2 + \frac{n_1(n_1+1)}{2} - R_1$$

where $n_1$ is the sample size of group 1, $n_2$ is the sample size of group 2, and $R_1$ is the sum of ranks for group 1.

Why are there two forms for the U test statistic? Is this the case where the first equation is actually the Wilcoxon $W$ statistic, which I understand to be functionally equivalent to $U$ (although not numerically equivalent)? I am a biochemist by training, so I apologize for any incorrect statements or assumptions in my question.

• There are in fact several equivalent test statistics -- (when you set up the alternative to correspond) they will always reject and fail to reject exactly the same sample arrangements as all the other versions. Some shift so the smallest value is 0 (as U_1 there does), some look at the sum of ranks in sample 2, or in the smaller of the two samples, some do other things for a variety of reasons. Commented Nov 6, 2014 at 21:55
• @Glen_b, thank you for the response. Would you care to formalize your comment as an answer? If so, can you include a reference that documents your point? Commented Nov 7, 2014 at 21:15
• I assume your second $U_1$ is meant to be $U_2$. Are you really asking for a reference that shows that (given the information in your question) $U_1=n_1n_2-U_2$, or are you asking for a reference for something else? Commented Nov 10, 2014 at 18:49
• @Glen_b: No, both are intentionally $U_1$. I have found references that define either of the individual forms as "the Mann Whitney U test statistic." However, I have not found one that lists multiple equivalent test statistics together. Can you recommend one that demonstrates that the equivalent forms are indeed functionally equivalent? Commented Nov 17, 2014 at 16:54
• Any strictly monotonic transformation of the first statistic will provide an equivalent test if you compute the permututation distribution of the test statistic under the null; all the various forms of the Mann-Whitney-Wilcoxon are linear transformations of each other. That those two forms in the question are linear transformations of each other is obvious from visual inspection. Showing any two forms* to be equivalent is usually left as an exercise for undergraduate students. Commented Nov 17, 2014 at 21:43

There are actually more than two forms of the Mann-Whitney-Wilcoxon test.

Given no ties (which I will assume throughout), the two forms you have there correspond to

(i) the number of times an observation in sample 1 exceeds an observation from sample 2, and

(ii) the number of times an observation in sample 2 exceeds an observation from sample 1.

We'd do best to distinguish those two definitions. Let's call them $U_{1>2}$ and $U_{2>1}$.

Note that $U_{1>2}+U_{2>1} = n_1 n_2$, the number of pairwise comparisons between sample 1 and sample 2.

$R_1$ is the sum of ranks in sample 1, one of the two common forms most associated with Wilcoxon (mentioned in the original paper) -- sometimes called W or occasionally U or T.

The other form associated with Wilcoxon (in the first tables of the statistic, published shortly after) is $W=R_1- \frac{n_1(n_1 + 1)}{2}$, the sum of ranks in sample 1 minus the smallest possible value for that sum. This form is equivalent to what I called $U_{1>2}$.

(More forms still are possible.)

These forms are all linearly related. As a result they yield equivalent tests (they should reject or fail to reject the null for the same samples under the same conditions).

• I believe the source of my original confusion is that the $U_1$ subscript had different/opposite meanings between references. Your note in my question above ("I assume your second $U_1$ is meant to be $U_2$") is illustrative of this. I assumed the two variables were "the same," thus the algebra would never show the two forms were equivalent. Thank you very much for your effort. I apologize that you spent your time clarifying what was ultimately an extremely simple misunderstanding of terms. Commented Nov 18, 2014 at 18:50
• I'm not surprised that confused you. It turns out to be a useful question because it gives the opportunity to explain connections between various forms of the test, and to mention the idea of equivalent tests. Commented Nov 18, 2014 at 21:48