The Mann-Whitney U test is essentially an alternative form of the Wilcoxon Rank-Sum test for independent samples and is completely equivalent.
Define the following test statistics for samples 1 and 2 where n1 is the size of sample 1 and n2 is the size of sample 2, and R1 is the adjusted rank sum for sample 1 and R2 is the adjusted rank sum of sample 2. It doesn’t matter which sample is bigger.
As for the Wilcoxon version of the test, if the observed value of U is < Ucrit then the test is significant (at the α level), i.e. we reject the null hypothesis. The values of Ucrit for α = .05 (two-tailed) are given in the Mann-Whitney Tables.
Example 1: Repeat Example 1 of the Wilcoxon Rank Sum Test using the Mann-Whitney U test.
Since R1 = 117.5 and R2 = 158.5, we can calculate U1 and U2 to get U = 39.5. Next we look up in the Mann-Whitney Tables for n1 = 12 and n2 = 11 to get Ucrit = 33. Since 33 < 39.5, we cannot reject the null hypothesis at α = .05 level of significance.
Property 2: For n1 and n2 large enough the U statistic is approximately normal N(μ, σ) where
Observation: Click here for proofs of Property 1 and 2.
Observation: Where there are a number of ties, the following revised version of the variance gives better results [Ro]:
where the sum is taken over all scores where ties exist and f is the number of ties at that level.
Example 2: Repeat Example 2 of the Wilcoxon Rank Sum Test using the Mann-Whitney U test.
As can be seen from Figure 2, the p-value for the one-tail test is the same as that found in Wilcoxon Example 2 using the Wilcoxon rank-sum test. Once again we reject the null hypothesis and conclude that non-smokers live longer.
Real Statistics Excel Functions: The following functions are provided in the Real Statistics Pack:
MANN(R1, R2) = U for the samples contained in ranges R1 and R2
MANN(R1, n) = U for the samples contained in the first n columns of range R1 and the remaining columns of range R1. If the second argument is omitted it defaults to 1.
MTEST(R1, R2) = p-value of the Mann-Whitney U test for the samples contained in ranges R1 and R2
MTEST(R1, n) = p-value of the Mann-Whitney U test for the samples contained in the first n columns of range R1 and the remaining columns of range R1. If the second argument is omitted it defaults to 1.
MCRIT(n1, n2, α, t) = critical value of the Mann-Whitney U test for samples of size n1 and n2, for the given value of alpha and t = 1 (one tail) or 2 (two tails).
These functions ignore any empty or non-numeric cells.
MTEST returns the one-tail version of the Mann-Whitney U test. Simply double the p-value generated to obtain the two-tail test.
Observation: In Example 1, we can use the supplemental function to arrive at the same value for U, namely MANN(A6:B17) = 39.5.
Similarly in Example 2, we can use the supplemental function to arrive at the same value for U, namely MANN(A6:H15,4) = MANN(A6:D15,E6:H15) = 486, as well as the same p-value (assuming a normal approximation described above), namely MTEST(A6:H15,4) = MTEST(A6:D15,E6:H15) = 0.003081.
Also note that the supplemental functions RANK_COMBINED and RANK_SUM, as defined in Wilcoxon Rank-Sum Test, can be used in conjunction with the Mann-Whitney test.
Observation: The effect size for the data using the Mann-Whitney test can be calculated in the same manner as for the Wilcoxon test, and the result will be the same.
The effect size of .31 for the data in Example 2 is calculated as in Figure 2. Namely, the z-score (cell T17) is calculated using the formula =(T13-T14)/T16 and the effect size (cell 20) is calculated by the formula =ABS(T17)/SQRT(T6+U6).
Also note that the z-score and the effect size r can be calculated using the supplemental function MTEST as follows:
z-score = NORMSINV(MTEST(R1, R2))
r = NORMSINV(MTEST(R1, R2))/SQRT(COUNT(R1)+COUNT(R2))
Observation: The results of analysis for Example 2 can be summarized as follows: The life expectancy of non-smokers (Mdn = 76.5) was significantly higher than that of smokers (Mdn = 70.5), U = 486, z = -2.74, p = .0038 < .05, r = .31.
Real Statistics Data Analysis Tool: The Real Statistics Resource Pack also provides a data analysis tool which performs the Mann-Whitney test for independent samples, automatically calculating the medians, rank sums, U test statistic, z-score, p-value and effect size r.
For example, to perform the analysis in Example 1, enter Ctrl-m and choose the T Test and Non-parametric Equivalents. The dialog box shown in Figure 3 appears.
Figure 3 – Dialog box for Real Statistics Mann-Whitney Test
Enter A5:B17 as the Input Range, click on Column headings included with data and choose the Two independent samples and Non-parametric options and click on OK. Keep the default of 0 for Hypothetical Mean/Median (this value is not used anyway) and .05 for Alpha. The output is shown in Figure 4.