6
$\begingroup$

Lets assume that I am having 2 samples:

Sample A

20
20
20
20
25

and Sample B

1
2
3
4
5

If I want to compare these two samples I can use the mann-whitney test. Now, because the 2 samples are not normally distributed, and their distributions do not have the same shape, the mann-whitney test will compare the mean ranks.

So what it will do, is rank each observation of each sample. The rank will be the following:

Sample A

 value  rank
    20  2.5
    20  2.5
    20  2.5
    20  2.5
    25  5

and Sample B

value  rank
    1  1
    2  2
    3  3
    4  4
    5  5

Now, both of those samples have the same mean rank (2.5+2.5+2.5+2.5+5)/5 and (1+2+3+4+5)/5, but their medians are very different.

Also it seems to me, that two populations of the same size, will always have the same mean rank. Or am I wrong ?

So I do not understand, what is the value of comparing the mean ranks of two populations. Any help ?

$\endgroup$
5
  • 1
    $\begingroup$ Welcome to CV, quant! $\endgroup$
    – Alexis
    Commented Sep 10, 2021 at 19:40
  • $\begingroup$ As an aside: the rank sum test will compare mean ranks regardless of the distribution of the data in each group, whether or not they are normal(-ish)ly distributed. $\endgroup$
    – Alexis
    Commented Sep 10, 2021 at 19:51
  • $\begingroup$ @Alexis Indeed the mann-whitney is non-parametric, but I thought the mann-whitney compares the medians if the distributions of the two samples have similar shape: statistics.laerd.com/spss-tutorials/… $\endgroup$
    – quant
    Commented Sep 11, 2021 at 9:53
  • 1
    $\begingroup$ It also compares the means of the data (not the ranks) if the population distributions of both groups have the same shape and the same variance. But those are some pretty additional strong assumptions (and your samples A & B certainly do not look like equal shapes or variances, for example). The fundamental null hypothesis, regardless of distribution, is that neither group is "stochastically larger": $\text{H}_{0}\text{: }P(X_{A} > X_B) = 0.5$ with $\text{H}_{0}\text{: }P(X_{A} > X_B) \ne 0.5$. $\endgroup$
    – Alexis
    Commented Sep 11, 2021 at 16:06
  • 1
    $\begingroup$ Whoops! Small correction in my previous comment, the second hypothesis should be labeled $\text{H}_{\text{A}}$. Sorry for any confusion. $\endgroup$
    – Alexis
    Commented Sep 12, 2021 at 17:30

1 Answer 1

10
$\begingroup$

When comparing two independent samples, you want to rank all the data together.

Revising your example:

Sample A

 value  rank
    20  7.5
    20  7.5
    20  7.5
    20  7.5
    25  10

and Sample B

value  rank
    1  1
    2  2
    3  3
    4  4
    5  5

What is going on?

Sample B's value of 1 is the lowest ordered value from both samples, so it gets a rank of 1. Similarly for Sample B's values of 2–5. The mean rank for Sample B is therefore $\frac{1+2+3+4+5}{5}=2.5$.

Sample A's values of 20, 20, 20, and 20 occupy the 6th, 7th, 8th, and 9th ranks together, so they each get the average rank of $\frac{6+7+8+9}{4\text{ rank positions}}=7.5$. Finally, Sample A's value of 10 is the largest value from both samples so it gets the highest rank 10. The mean rank for Sample A is therefore $\frac{7.5+7.5+7.5+7.5+10}{5}=8$.

Bonus: To be super explicit: No. The mean ranks of two independent samples of the same $\boldsymbol{N}$ will not necessarily have the same mean ranks.

$\endgroup$

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.