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 dm^{3} 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 dm^{3} d^{1} 
Species 1 
Rank 1 (R_{1}) 
Species 2 
Rank 2 (R_{2}) 
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 dm^{3} d^{1} 
Species 1 
Rank 1 (R_{1}) 
Species 2 
Rank 2 (R_{2}) 
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 

∑R_{1} = 32.5 

∑R_{2} = 72.5 
4. You then need to work out U1 and U2 (this is the fun part where you wish you had MegaStat!) where n_{1} is the number of sample in herd 1 and n_{2} is the number of samples in herd 2.
U1 = [(n_{1} x n_{2}) + [1/2 n_{2}(n_{2} + 1)]]  ∑R_{2}
U1 = [(7 x 7) + [3.5(8)]]  72.5
U1 = (49 + 28)  72.5
U1 = 77  72.5
U1 = 4.5
U2 = [(n_{1} x n_{2}) + [1/2 n_{1}(n_{1} + 1)]]  ∑R_{1}
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 n_{1} and n_{2} 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.