I'm trying to understand this boxplot, where I'm rejecting null hypothesis, but it amazes me how can it reject it since it looks so similar, i.e. equal for the variable.

Does it mean if their medians are the same the hypothesis will also say it is the same?

enter image description here

  • 2
    $\begingroup$ The Mann-Whitney test is only a test of medians if the shape of the distributions is the same. Clearly, this is not the case here. $\endgroup$
    – Emma Jean
    Jan 31, 2023 at 20:51
  • 5
    $\begingroup$ I don't think boxplots are very helpful with discrete variables only taking a few distinct values. Its not hard to see that the second boxplot often takes higher values than the first $\endgroup$
    – Glen_b
    Jan 31, 2023 at 20:54
  • 2
    $\begingroup$ It might help some answerers illustrate why there seems to be a location difference if you were to tabulate the counts in each outcome value for each group (it's just 8 counts); it's hard to do from the plot. $\endgroup$
    – Glen_b
    Jan 31, 2023 at 21:16
  • 2
    $\begingroup$ When values are just 1, 2, 3, 4 medians and quartiles are usually one of these values or exceptionally half-way between two of them. That is not helpful. Paradoxically, or otherwise, when values are so coarse the most informative summary may be based on means instead. $\endgroup$
    – Nick Cox
    Jan 31, 2023 at 23:13

1 Answer 1


The Mann-Whitney test is not in general a test of medians. Instead, it is a test of whether the values in one group tend to be higher than the other group.

In your data Group 2 has few observations of "1" or "2", and relatively many of "3" and "4", when compared with Group 1. This is formalized with the rank biserial coefficient and with the Mann-Whitney test.

Instead, if you want to compare the medians, you can use a test of medians.

A useful way to present this data is with a bar plot of the response categories ("1", "2", "3", "4") for each of the Groups. A few possibilities are in links below.





Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.