UCLA Academic Technology Services HomeServicesClassesContactJobs
Search

FAQ: Why is the Mann-Whitney significant when the medians are equal?

A client has sent us the following question:

Q.   I ran a Mann-Whitney test on two independent groups that have equal medians, the results were significant. I thought that the Mann-Whitney tested differences in medians. Why is the Mann-Whitney test be significant when the medians are equal?


A.   The answer is that the Mann-Whitney and the equivalent Wilcoxen test (hereafter called the Mann-Whitney-Wilcoxen test) are rank sum tests and not median tests. Basically, the Mann-Whitney-Wilcoxen test ranks all of the observations from both groups and then sums the ranks from one of the groups which is compared with the expected rank sum. It is possible, although not very common, for groups to have different rank sums and yet have equal or nearly equal medians. An example is given below.

Consider the following example dataset of 120 observation (60 in each group) that has equal medians and a significant Mann-Whitney-Wilcoxen test.

  +-----------------+
  |  y   grp   freq |
  |-----------------|
  | -2     1     20 |
  |  0     1     20 |
  |  5     1     20 |
  |-----------------|
  | -1     2     20 |
  |  0     2     20 |
  | 10     2     20 |
  +-----------------+
The median for each of the two groups is zero, yet the Z-approximation for the Mann-Whitney-Wilcoxen is -2.16 with a p-value of .031. On the other hand, a median test yields a t-value = 0 with p = 1.0.

The reason the Mann-Whitney-Wilcoxen is significant for the above data is the ranks for Grp 1 (other than those at the median) are lower than the ranks for Grp 2 (again, other than those values at the median). Here are the ranks for all the scores ignoring the frequencies to keep it simple.

  +-------------------+
  |  y   grp     rank |
  |-------------------|
  | -2     1      1   |
  | -1     2      2   |
  |  0     2     3.5  |
  |  0     1     3.5  |
  |  5     1      5   |
  | 10     2      6   |
  +-------------------+
Note that the value of -2 has a rank of 1 and the value -1 has a rank of 2. The values 5 and 10 have ranks of 5 and 6 respectively. The 0 scores all have a rank of 3.5. Thus, other than the median (rank 3.5), all of the ranks for Grp1 are less than the ranks for Grp 2. With sufficient sample size the difference in ranks will be large enough to be significant even though the medians are equal.

The table below gives the sum of the ranks for each group for the full sample of 120 observations.

         Grp       obs    rank sum
          1         60        3230
          2         60        4030
Grp 2 clearly has a much larger sum of ranks than Grp 1. The difference in the sum of ranks is large enough to be statistically significant at the alpha equals .05 level.


How to cite this page

Report an error on this page

UCLA Researchers are invited to our Statistical Consulting Services
We recommend others to our list of Other Resources for Statistical Computing Help
These pages are Copyrighted (c) by UCLA Academic Technology Services


The content of this web site should not be construed as an endorsement of any particular web site, book, or software product by the University of California.