The Mann-Whitney U test is a non-parametric rank test to assess "whether one of two samples of independent observations tends to have larger values than the other." The test statistic ($U$) is constructed by counting, for each observation in the first sample, how many observations from the second sample have a smaller rank (count 1/2 for any that are equal to it): $U = \sum_{i=1}^I \sum_{j=1}^J \mathbb{I}_{y_i \lt x_j}.$