MannWhitney U test
This test will tell you whether the medians of two sets of data are significantly different to one another. It works on unmatched, interval or ordinal data (see section on "Different kinds of data"). It does not require that the data is normally distributed but it does require that both data sets are the same shape.
Lets say you are investigating the effects of lifestyle on human body size. You feel it to be too much of an intrusion to measure people's weight or girth directly, so you invent a way of assessing their size remotely.
You select two sites: Site one is outside the well known fastfood chain McBloaters. Site two is outside the well known healthfood chain McSmugs.
You stand outside both establishments and simply assess the body size of the punters patronising them on the following scale:
1 = Skeletalmmmmm2 = Thinmmmmm3 = Mediummmmmm4 = Plumpmmmmm5 = Fatmmmmm6 = Bloater
You obtain the following results:
Sample 








Mc Bloaters 








Mc Smugs 








Firstly we state our null hypothesis (it's always the same for this test):
There is no significant difference between the medians of the two sets of data
Next we put the data in order from smallest to highest:
Mc Bloaters 









Mc Smugs 









Next assign a rank to each piece of data:
Mc Bloaters 









RANK 









Mc Smugs 









RANK 








Notice the lowest value is 1 (McBloaters data set), so this receives a rank of 1. Next we have three tied values (three values of 2 from the McBloater data set). These 3 items of data occupy three ranks but they are all of the same value, so we share out the ranks thus: rank 2 + rank 3 + rank 4 = 9. Divide by three and we end up with a rank of 3 for each piece of data. (See the red rank row below McBloaters).
The next values come from the McBloaters and the McSmugs data set: A value of 3 from McBloaters and two tied values of 3 from McSmugs. We deal with these in the same way. We have used ranks up to 4 so the next three ranks that are available are rank 5, rank 6 and rank 7. Add these together and share them out equally: 5 + 6 + 7 = 18/3 = 6.
Continue doing this to complete the table and the only moderately hard part of doing this test is over.
Add up the ranks for each data set:
Sum of McBloater ranks = 47.5
Sum of McSmug ranks = 88.5
Calculate the value U for each sample:
We can now check our calculations because U1 + U2 should equal n1 x n2. Happily, in our case this is indeed true.
We now take the smaller of the two values as our calculated test statistic. Our calulated value of U is then 11.5
Our next task is to compare our calculated value with the critical value obtained from a table of critical values of U:
n1/n2 















































































We enter the table at the correct number of items of data for each data set (row 8 and column 8 in our case). The critical value of U is therefore: 13
Our calculated value of U was 11.5
In a MannWhitney U test if the calculated value of U is less than the critical value we reject the null hypothesis. In rejecting our hypothesis of no difference we are saying that the medians of the two sets of data are indeed significantly different. In doing this at the 5% significance level we would expect to be correct in rejecting our null hypothesis 95% of the time.
We might also learn from this example of the dangers of jumping to conclusions. I would bet that most people expected McBloaters to have the fatter people using it. It just goes to show, if you eat too much of anything (even McSmugs lentil surprise) you will get fat. Let our maxim be "tolerance, moderation, healthy exercise, wholesomeness, crispness and rhubarb".
If you've got 25+ samples in both data sets use a z test (see "T test" section).
Looking for a next step?
The FSC offers a range of publications, courses for schools and colleges and courses for adults, families and professionals that relate to the freshwater environment. Why not find
out more about the FSC?
FEEDBACK
Do you have any questions?
Site Statistics by Opentracker