![]()
The most common test you will use will probably be a t-test for uncorrelated means (interval data). However, there will be times you cannot meet the assumptions for this test, or times when you have ordinal data, and need a nonparametric test. The Mann-Whitney U Test is one of those nonparametric tests. There is no such thing as a free lunch, of course, so the Mann-Whitney U is less powerful (more conservative, or less likely to find a difference if a real difference exists) than a t-test.
It is for:
1. independently-drawn random samples, the sizes of which need not be the same
2. for samples where the larger is nine or more
(If both sample sizes are eight or fewer measures, Siegel (1956) has a method and tables that apply.)
Like a Kruskal-Wallis, the Mann-Whitney U works by first ranking the data.
The way it works is that the scores in both groups are combined into one data set ranked from lowest to highest. The rank of each score is recorded and when two or more scroes are tied, all of the tied scores get the same rank - a rank equal to the average of the positions in the ordered array. For example, if three scores are tied for position 3, 4, and 5, all would be assigned the rank of 4.
Then, the rank order scores are reassigned to their original groups and the following equation is used to compute the Mann-Whitney U statistic:

That equation calls for the following in words:
1. Multiply the number of subjects in the first sample times the number in the second. Set this value aside.
2. Now, multiply the number in the first sample times the number in the first sample plus 1
3. Divide the value from #2 above by 2. Set this value aside.
4. Add the ranks you assigned to the scores in the first sample. Set this value aside.
5. Add the value you obtained in #1 above to the value you obtained in #3 above.
6. Subtract the value you obtained in #4 above from the value you obtained in #5 above.
7. The resulting value is the Mann-Whitney U. You can then look up the critical values of U in a table and compare it to your obtained value. Some tables are set up so that your obtained value must be LESS than the critical value (contrary to the way the t-test works!), while others are set up to show you two values - if your obtained value falls between the two tabled value there is NO difference - it if falls HIGHER or LOWER there is a difference.
Sprinthall, on the other hand (p. 409) gives you a formula and lets you calculate z sub U and then use a z table. If you do that, if your z sub U is greater than 2.58, it is sig. at the .01 level. If it is greater than 1.96, it is sig. at the .05 level (the same critical values we use for any z test, of course).
Fortunately, SPSS has a routine and you do not have to calculate the U statistic by hand unless you want to do so. (Since the calculations are so simple, it is sometimes easier to run on a calculator than to bother with a computer.)
Here is the SPSS definition of the Mann-Whitney U Test:
M-W (alias MANN-WHITNEY) compares two independent samples defined by a grouping variable on a single test variable.So, like the Kruskal-Wallis (the nonparametric test that is the analog of an ANOVA for more than two means), you use the NPAR TESTS command, but with the M-W subcommand. (If you run a Kruskal-Wallis with only two groups, the result is the same as Mann-Whitney. This makes sense, and should remind you that an ANOVA with only two groups yields the same result as a t-test.)
Here is an example.
Suppose you have scores from two independently drawn samples as follows:
Group A Group B
14 18
12 16
13 15
10 14
7 19
6 7
4 8
6
3
Here is a data file you might make up:
01 14 1
02 12 1
03 13 1
04 10 1
05 07 1
06 06 1
07 04 1
08 18 2
09 16 2
10 15 2
11 14 2
12 19 2
13 07 2
14 08 2
15 06 2
16 03 2
Here is an SPSS program file:
title "mann whitney - sample14.dat"
data list file = "sample14.dat"
/id 1-2 score 4-5 group 7
variable labels
id 'subject identification no.'
score 'score on test'
group 'study group'
value labels
group 1 'control' 2 'experimental'/
set width=80
npar tests m-w=score by group(1,2)
/statistics=all
finish
Here is the output from this program:
1 0 title "mann whitney - sample14.dat"
2 0 data list file = "sample14.dat"
3 0 /id 1-2 score 4-5 group 7
This command will read 1 records from sample14.dat
Variable Rec Start End Format
ID 1 1 2 F2.0
SCORE 1 4 5 F2.0
GROUP 1 7 7 F1.0
4 0 variable labels
5 0 id 'subject identification no.'
6 0 score 'score on test'
7 0 group 'study group'
8 0 value labels
9 0 group 1 'control' 2 'experimental'/
10 0 set width=80
11 npar tests m-w=score by group(1,2)
12 /statistics=all
N Mean Std Dev Minimum Maximum
SCORE 16 10.750 5.040 3 19
GROUP 16 1.563 .512 1 2
(Median)
25th 50th 75th
N Percentile Percentile Percentile
SCORE 16 6.25 11.00 14.75
GROUP 16 1.00 2.00 2.00
- - - - - Mann-Whitney U - Wilcoxon Rank Sum W Test
SCORE score on test
by GROUP study group
Mean Rank Cases
7.07 7 GROUP = 1 control
9.61 9 GROUP = 2 experimental
--
16 Total
Exact Corrected for ties
U W 2-Tailed P Z 2-Tailed P
21.5 49.5 .2991 -1.0609 .2888
13 finish
You can see that the mean rank of the control group was 7.07, while the mean rank of the experimental group was 9.61.
Our test to see if this is a real difference (rather than sampling error) yielded a Mann-Whitney U of 21.5. (The W above is the rank sum of the smaller group, which you can ignore for now).
To determine if the U of 21.5 is significant, look under "2-tailed P corrected for ties" above.
Notice it is .2888.
This tells us that there are almost 29 chances out of 100 of getting groups as different as the ones in our study when there are no real differences in the population.
Therefore, our test is not significant and we accept the null hypothesis of no differences.
_____1. For your homework, make up a research study with two groups, similar to above. Put 10 cases in one group and eight in the other. Try to manipulate the data so there IS a difference. Then write a data file and program file. Print these out and attach.
_____2. Run the program file, print out the output file and attach.
_____3. Was the analysis significant?___________________
_____4. How do you know? ___________________________
_____5. What was the U? __________________
_____6. What was the probability level? ____________________
_____7. Write a brief paragraph coming to conclusions about your study. Do you accept or reject the null hypothesis? In regular English, tell us what you found in your study. Print out a copy of everything, fill out this sheet, and attach a copy.
Click here to go to the home page for CEP740 - Advanced Educational Measurements and Statistics
Click here to return to the STATISTICS COURSES TAUGHT BY CLEB MADDUX PAGE.