Mann-Whitney-Wilcoxon test

This page offers all the basic information you need about the mann-whitney-wilcoxon test. It is part of Statkat’s wiki module, containing similarly structured info pages for many different statistical methods. The info pages give information about null and alternative hypotheses, assumptions, test statistics and confidence intervals, how to find p values, SPSS how-to’s and more.

To compare the mann-whitney-wilcoxon test with other statistical methods, go to Statkat's or practice with the mann-whitney-wilcoxon test at Statkat's

Contents

When to use?

Deciding which statistical method to use to analyze your data can be a challenging task. Whether a statistical method is appropriate for your data is partly determined by the measurement level of your variables. The mann-whitney-wilcoxon test requires the following variable types:

Variable types required for the mann-whitney-wilcoxon test :
Independent/grouping variable:
One categorical with 2 independent groups
Dependent variable:
One of ordinal level

Note that theoretically, it is always possible to 'downgrade' the measurement level of a variable. For instance, a test that can be performed on a variable of ordinal measurement level can also be performed on a variable of interval measurement level, in which case the interval variable is downgraded to an ordinal variable. However, downgrading the measurement level of variables is generally a bad idea since it means you are throwing away important information in your data (an exception is the downgrade from ratio to interval level, which is generally irrelevant in data analysis).

If you are not sure which method you should use, you might like the assistance of our method selection tool or our method selection table.

Null hypothesis

The mann-whitney-wilcoxon test tests the following null hypothesis (H0):

If the dependent variable is measured on a continuous scale and the shape of the distribution of the dependent variable is the same in both populations: Else:
Formulation 1: Formulation 2: Several different formulations of the null hypothesis can be found in the literature, and we do not agree with all of them. Make sure you (also) learn the one that is given in your text book or by your teacher.
Alternative hypothesis

The mann-whitney-wilcoxon test tests the above null hypothesis against the following alternative hypothesis (H1 or Ha):

If the dependent variable is measured on a continuous scale and the shape of the distribution of the dependent variable is the same in both populations: Else:
Formulation 1: Formulation 2:
Assumptions

Statistical tests always make assumptions about the sampling procedure that was used to obtain the sample data. So called parametric tests also make assumptions about how data are distributed in the population. Non-parametric tests are more 'robust' and make no or less strict assumptions about population distributions, but are generally less powerful. Violation of assumptions may render the outcome of statistical tests useless, although violation of some assumptions (e.g. independence assumptions) are generally more problematic than violation of other assumptions (e.g. normality assumptions in combination with large samples).

The mann-whitney-wilcoxon test makes the following assumptions:

Test statistic

The mann-whitney-wilcoxon test is based on the following test statistic:

Two different types of test statistics can be used; both will result in the same test outcome. The first is the Wilcoxon rank sum statistic $W$: The second type of test statistic is the Mann-Whitney $U$ statistic: where $n_1$ is the sample size of group 1.

Note: we could just as well base W and U on group 2. This would only 'flip' the right and left sided alternative hypotheses. Also, tables with critical values for $U$ are often based on the smaller of $U$ for group 1 and for group 2.
Sampling distribution

Sampling distribution of $W$ and of $U$ if H0 were true:

Sampling distribution of $W$:
For large samples, $W$ is approximately normally distributed with mean $\mu_W$ and standard deviation $\sigma_W$ if the null hypothesis were true. Here $$ \begin{aligned} \mu_W &= \dfrac{n_1(n_1 + n_2 + 1)}{2}\\ \sigma_W &= \sqrt{\dfrac{n_1 n_2(n_1 + n_2 + 1)}{12}} \end{aligned} $$ Hence, for large samples, the standardized test statistic $$ z_W = \dfrac{W - \mu_W}{\sigma_W}\\ $$ follows approximately the standard normal distribution if the null hypothesis were true. Note that if your $W$ value is based on group 2, $\mu_W$ becomes $\frac{n_2(n_1 + n_2 + 1)}{2}$.

Sampling distribution of $U$:
For large samples, $U$ is approximately normally distributed with mean $\mu_U$ and standard deviation $\sigma_U$ if the null hypothesis were true. Here $$ \begin{aligned} \mu_U &= \dfrac{n_1 n_2}{2}\\ \sigma_U &= \sqrt{\dfrac{n_1 n_2(n_1 + n_2 + 1)}{12}} \end{aligned} $$ Hence, for large samples, the standardized test statistic $$ z_U = \dfrac{U - \mu_U}{\sigma_U}\\ $$ follows approximately the standard normal distribution if the null hypothesis were true.

For small samples, the exact distribution of $W$ or $U$ should be used.

Note: if ties are present in the data, the formula for the standard deviations $\sigma_W$ and $\sigma_U$ is more complicated.
Significant?

This is how you find out if your test result is significant:

For large samples, the table for standard normal probabilities can be used:
Two sided: Right sided: Left sided:
Equivalent to

The mann-whitney-wilcoxon test is equivalent to:

If there are no ties in the data, the two sided Mann-Whitney-Wilcoxon test is equivalent to the Kruskal-Wallis test with an independent variable with 2 levels ($I$ = 2).
Example context

The mann-whitney-wilcoxon test could for instance be used to answer the question:

Do men tend to score higher on social economic status than women?
SPSS

How to perform the mann-whitney-wilcoxon test in SPSS:

Analyze > Nonparametric Tests > Legacy Dialogs > 2 Independent Samples...
Jamovi

How to perform the mann-whitney-wilcoxon test in jamovi:

T-Tests > Independent Samples T-Test