The Mann-Whitney test is a nonparametric test you can use when you want to know if two populations are similar – it tells you if they have the same median. You might sometimes find this test referred to by one of its two aliases: the Mann-Whitney-Wilcoxon test, or the Wilcoxon rank sum test.
This test can be used when you want to determine whether the central value is equal between two populations, or when your population’s data distribution is non-normal or unknown.
Like any parametric, two-sample test for means, the Mann-Whitney test allows your company to compare the central value of two populations to determine if they’re significantly different. It’s also similar to analysis of variance – ANOVA – or to nonparametric equivalents – such as Kruskal-Wallis. However, the differences are that the Mann-Whitney test compares medians rather than means, and it is limited to comparing only two, rather than multiple, populations.
It’s important to understand the assumptions under which Mann-Whitney works. The first is that the data source in each population is from independent and random samples. The second is that the populations have the same or similar distributions, or shapes, and equal variances. Finally, the value for n1– the size of the first sample – must be less than or equal to the size of n2 – the second sample.
The mechanics of the Mann-Whitney test are similar to those of the Kruskal-Wallis test in that they both involve ranking all the data values. However, in this case, the test statistic – M – is only the sum of the smaller sample. The test result is then compared to a critical value that is found in the Mann-Whitney critical value table.
Performing a Mann-Whitney test
Conducting a Mann-Whitney test involves performing the same steps as you do with other hypothesis tests:
- define the business problem
- establish the hypotheses
- determine the test parameters
- calculate the test statistic
- interpret the results
Determining the test parameters involves defining degrees of freedom and the alpha value. For some other tests, you have to actually calculate the degrees of freedom. However, in the case of the Mann-Whitney test, you simply find the values for each sample size in the Mann-Whitney table. The alpha value is typically set at 0.05.
Calculating the test statistic entails performing two tasks. First, you use a tally table to assign a rank to each instance of a data value based on its rank among all data values from all samples. When two or more observations are tied, you simply assign the average rank to each.
The second task when you’re calculating the test statistic is to add up the ranks for the original data. If you remember this procedure from the Kruskal-Wallis test, you’ll recall that the table had columns for ranks for all the samples. But in the case of Mann-Whitney, there’s only one column for ranks. That’s because the Mann-Whitney test only requires that you add the ranks for the smallest sample.
Once you’ve calculated the sum of the ranks for the smaller of the two samples, you’ve found the test statistic, M.
When interpreting the results, you use the Mann-Whitney critical value table, which was developed specifically for this test. The letters MI represent left-tailed tests, and Mr represent right-tailed tests.
The test works only when three conditions hold true: the data from each population must be independent and random; the populations must have the same or similar distributions and equal variances; and the first sample must be less than or equal to the second sample.
The Mann-Whitney test follows the basic procedure for hypothesis testing. The procedure for finding degrees of freedom is slightly different, however – you simply find the values for each sample size in the Mann-Whitney table. To calculate the test statistic, you calculate the sum of the ranks for the smaller of the two samples.