Report

Help us improve this tool

Mann Whitney U Test Calculator

Perform a Mann-Whitney U test on two independent groups and get critical values, z-scores, p-values, and a step-by-step ranks table.

O M T

What is the Mann-Whitney U Test?

The Mann-Whitney U test, also known as the Wilcoxon rank-sum test, is a popular non-parametric statistical hypothesis test. It is used to determine whether there is a significant difference between the medians of two independent groups. Unlike the parametric t-test, the Mann-Whitney U test does not assume that the underlying data follows a normal distribution, making it ideal for ordinal data or skewed continuous data.

The null hypothesis ($H_0$) states that the distributions of both groups are equal. The alternative hypothesis ($H_a$) suggests that one population tends to have larger values than the other (one-tailed) or that they differ in some way (two-tailed).

How the Mann-Whitney U Statistic is Calculated

The calculation involves combining the data from both groups, sorting them, and assigning ranks from $1$ to $N$ (where $N = n_1 + n_2$). If there are tied values, they are assigned the average of the ranks they would have otherwise occupied.

Next, the sum of ranks for each group is calculated ($R_1$ for group 1 and $R_2$ for group 2). The U statistics are then calculated as: $$U_1 = n_1 n_2 + \frac{n_1(n_1 + 1)}{2} - R_1$$ $$U_2 = n_1 n_2 + \frac{n_2(n_2 + 1)}{2} - R_2$$ The final Mann-Whitney U statistic is the smaller of these two values: $$U = \min(U_1, U_2)$$

Normal Approximation for Larger Samples

When both sample sizes ($n_1$ and $n_2$) are greater than 8 or 10, the distribution of $U$ approaches a normal distribution. We can calculate the z-score using: $$z = \frac{U - m_U}{\sigma_U}$$ Where the expected mean $m_U$ is: $$m_U = \frac{n_1 n_2}{2}$$ And the standard deviation $\sigma_U$ (adjusted for ties) is: $$\sigma_U = \sqrt{\frac{n_1 n_2}{N(N-1)} \left( \frac{N^3 - N}{12} - \sum \frac{t_i^3 - t_i}{12} \right)}$$ Here, $t_i$ represents the number of tied values in the $i$-th tie group. The calculated z-score is then used to find the corresponding p-value.

Frequently Asked Questions

When should I use the Mann-Whitney U test instead of an independent t-test?

You should use the Mann-Whitney U test when your data violates the assumptions of the parametric t-test. Specifically, use it if your sample size is small and the data is not normally distributed, if your data contains major outliers, or if you are analyzing ordinal (ranked) data rather than continuous data.

How are ties handled in the rankings?

Ties occur when two or more observations have the exact same value. In such cases, all tied observations are assigned the average of the ranks they would have received. For example, if two values are tied for ranks 3 and 4, they both receive a rank of 3.5.

What does a significant P-value mean in this test?

If the calculated p-value is less than your chosen significance level (commonly $\alpha = 0.05$), you reject the null hypothesis. This indicates a statistically significant difference between the two sample groups, meaning one group systematically tends to have higher or lower values than the other.

Can this test be used for paired samples?

No. The Mann-Whitney U test is only for independent (unpaired) groups. If your samples are paired or dependent (such as pre-test and post-test scores from the same subjects), you should use the Wilcoxon signed-rank test instead.