Brunner Munzel Test

In statistics, the Brunner Munzel test  (also called the generalized Wilcoxon test) is a nonparametric test of the null hypothesis that, for randomly selected values X and Y from two populations, the probability of X being greater than Y is equal to the probability of Y being greater than X.

It is thus highly similar to the well-known Mann–Whitney U test. The core difference is that the Mann-Whitney U test assumes equal variances and a location shift model, while the Brunner Munzel test does not require these assumptions, making it more robust and applicable to a wider range of conditions. As a result, multiple authors recommend using the Brunner Munzel instead of the Mann-Whitney U test by default.

Assumptions and formal statement of hypotheses

 * 1) All the observations from both groups are independent of each other,
 * 2) The responses are at least ordinal (i.e., one can at least say, of any two observations, which is the greater),
 * 3) Under the null hypothesis H0, is that the probability of an observation from population X exceeding an observation from population Y is the same than the probability of an observation from Y exceeding an observation from X; i.e.,  $P(X > Y) = P(Y > X)$ or $P(X > Y) + 0.5 · P(X = Y) = 0.5$.
 * 4) The alternative hypothesis H1 is that $P(X > Y) ≠ P(Y > X)$ or $P(X > Y) + 0.5 · P(X = Y) ≠ 0.5$

Under these assumptions, the test is consistent and approximately exact test. The crucial difference compared to the Mann–Whitney U test is that the latter is not approximately exact under these assumptions. Both tests are exact when additionally assuming equal distributions under the null hypothesis.

Software implementations
The Brunner Munzel test is available in the following packages
 * R: brunnermunzel, lawstat
 * Python (programming language): scipy.stats.brunnermunzel
 * jamovi: bmtest