17.5.4.2 Algorithms (Mann-Whitney Test)
Consider two independent samples
and
, with the size of
and
, and the sample data is denoted as
and
respectively.
The null hypothesis,
, is that the two distributions are the same. And this is to be tested against an alternative hypothesis
which is:
; or
, the
's tend to be greater than the
's; or
, the
's tend to be less than the
's.
The test procedure includes the following steps:
- Combine
,
in a group.
- Rank them in ascending order. Ties receive the average of their ranks. Let
be the ranks assigned to
, for
and be the ranks assigned to
, for
.
- Calculate sum of ranks:
, and /math-443e369d22f03a15147ddce7585c5b22.png?v=0)
- Test statistic
is defined as follow:
- The approximate Normal test statistic
is calculated as:
.
is the number of ties in the sample and
is the number of ties in the jth group.
Note that if no ties are present, the variance of
reduces to
For more details of the algorithm, please refer to nag_mann_whitney (g08amc)
/math-42f3622e67a4b7662e78f6c155b8ec10.png?v=0)
/math-2590c4a4b785dfcc8e3983885df66db6.png?v=0)
/math-28ce0d26a8607fa489594ca9a1d7cc31.png?v=0)
/math-ef94a3f17a70689ec4c0b3b8808715e6.png?v=0)