SciPy

scipy.stats.mannwhitneyu

scipy.stats.mannwhitneyu(x, y, use_continuity=True, alternative='two-sided')[source]

Computes the Mann-Whitney rank test on samples x and y.

Parameters:

x, y : array_like

Array of samples, should be one-dimensional.

use_continuity : bool, optional

Whether a continuity correction (1/2.) should be taken into account. Default is True.

alternative : ‘less’, ‘two-sided’, or ‘greater’

Whether to get the p-value for the one-sided hypothesis (‘less’ or ‘greater’), or for the two-sided hypothesis (‘two-sided’, is the default)

Returns:

statistic : float

The Mann-Whitney statistics.

pvalue : float

One-sided p-value assuming a asymptotic normal distribution.

Notes

Use only when the number of observation in each sample is > 20 and you have 2 independent samples of ranks. Mann-Whitney U is significant if the u-obtained is LESS THAN or equal to the critical value of U.

This test corrects for ties and by default uses a continuity correction.

Previous topic

scipy.stats.ks_2samp

Next topic

scipy.stats.tiecorrect