Maths & Statistics Home Mann Whitney U Test  

This test is used if you do not have enough data to do a Student t-Test or if the distribution of data is unknown or has a non-normal distribution.

Although it will tell you if a difference is significant, it is not as powerful as the Student t-Test in identifying a significant difference.

Requirements:

● Data is unmatched or independent
● Data has a minimum of 7 values for each data set

An example of when this test would be used is if you have measured the yield of milk from 2 different herds and you only have 7 measurements for each herd.

Milk yield of a cow dm3 d-1
Species 1
Species 2
12
17
9
23
17
19
19
16
10
19
11
21
15
21

It is possible to do this test in Excel if you enter everything manually but it is not programmed into Excel or Data Analysis so you will have to do it by hand or by using MegaStat.

Click here for instructions on how to do the Mann Whitney U Test. Once open, select the method you want to use.

  • MegaStat
  • By Hand

We will use the example of the milk yield shown above.

1. Put the data into Excel:

2. Open the MegaStat menu and in the Nonparametric Tests, select Wilcoxon - Mann/Whitney Test...

3. The following window will appear:

4. Select the data range for the two groups. In this example, group 1 is A3:A9 and group 2 is B3:B9

5. You can tick the Output rank data box if you are interested but it has little relevance if you are doing it using MegaStat (it has plenty of relevance if you are doing it by hand).

6. Leave the box Correct for ties ticked and leave the Alternative as not equal

7. The dialog box should now look like this:

8. The output sheet will show you the p value:

9. In this case it is 0.0121 and as it is smaller than 0.05, it means the difference between the two herds of cows is significant (as shown by the fact it is highlighted in yellow).

This means that Herd 2 produces significantly more milk than Herd 1.

There is no straightforward equation for this test, you need to rank the data before you can apply the formulas. We will use the example of the milk yield shown above.

1. Put all the data in ascending order:

Milk yield of a cow dm3 d-1
Species 1
Species 2
9
16
10
17
11
19
12
19
15
21
17
21
19
23

2. Put all the data ascending rank order, the ranks are common to both sets of data:

Milk yield of a cow dm3 d-1
Species 1
Rank 1 (R1)
Species 2
Rank 2 (R2)
9
1
10
2
11
3
12
4
15
5
16
6
17
7.5
17
7.5
19
10
19
10
19
10
21
12.5
21
12.5
23
14

There is a number 17 in both Herd 1 and Herd 2 and as they are in position 7 and 8, you average the rank giving a mean rank of 7.5 for both. The same applies to number 19, there are three occupying position 9, 10 and 11 and the mean of the three positions is 10.

3. You then sum the ranks:

Milk yield of a cow dm3 d-1
Species 1
Rank 1 (R1)
Species 2
Rank 2 (R2)
9
1
10
2
11
3
12
4
15
5
16
6
17
7.5
17
7.5
19
10
19
10
19
10
21
12.5
21
12.5
 
23
14
∑R1 = 32.5
∑R2 = 72.5

4. You then need to work out U1 and U2 (this is the fun part where you wish you had MegaStat!) where n1 is the number of sample in herd 1 and n2 is the number of samples in herd 2.

U1 = [(n1 x n2) + [1/2 n2(n2 + 1)]] - ∑R2
U1 = [(7 x 7) + [3.5(8)]] - 72.5
U1 = (49 + 28) - 72.5
U1 = 77 - 72.5
U1 = 4.5

U2 = [(n1 x n2) + [1/2 n1(n1 + 1)]] - ∑R1
U2 = [(7 x 7) + [3.5(8)]] - 32.5
U2 = (49 + 28) - 32.5
U2 = 77 - 32.5
U2 = 44.5

5. You use the Critical Value Table for the Mann Whitney U Test. It doesn't use Degrees of Freedom, you use the number of samples for each data set as coordinates.

6. In this example, we have 7 numbers for n1 and n2 and the Critical U Value is 8.

7. The calculated value we use is 4.5 as it is the smallest of the two U values calculated.

8. The calculated U value is smaller than the critical U value therefore the difference between the two herds of cows is significant.

This means that Herd 2 produces significantly more milk than Herd 1.