scipy.stats.brunnermunzel¶

scipy.stats.
brunnermunzel
(x, y, alternative='twosided', distribution='t', nan_policy='propagate')[source]¶ Computes the BrunnerMunzel test on samples x and y
The BrunnerMunzel test is a nonparametric test of the null hypothesis that when values are taken one by one from each group, the probabilities of getting large values in both groups are equal. Unlike the WilcoxonMannWhitney’s U test, this does not require the assumption of equivariance of two groups. Note that this does not assume the distributions are same. This test works on two independent samples, which may have different sizes.
 Parameters
 x, yarray_like
Array of samples, should be onedimensional.
 alternative‘less’, ‘twosided’, or ‘greater’, optional
Whether to get the pvalue for the onesided hypothesis (‘less’ or ‘greater’) or for the twosided hypothesis (‘twosided’). Defaults value is ‘twosided’ .
 distribution: ‘t’ or ‘normal’, optional
Whether to get the pvalue by tdistribution or by standard normal distribution. Defaults value is ‘t’ .
 nan_policy{‘propagate’, ‘raise’, ‘omit’}, optional
Defines how to handle when input contains nan. ‘propagate’ returns nan, ‘raise’ throws an error, ‘omit’ performs the calculations ignoring nan values. Default is ‘propagate’.
 Returns
 statisticfloat
The BrunnerMunzer W statistic.
 pvaluefloat
pvalue assuming an t distribution. Onesided or twosided, depending on the choice of alternative and distribution.
See also
mannwhitneyu
MannWhitney rank test on two samples.
Notes
Brunner and Munzel recommended to estimate the pvalue by tdistribution when the size of data is 50 or less. If the size is lower than 10, it would be better to use permuted Brunner Munzel test (see [2]).
References
 1
Brunner, E. and Munzel, U. “The nonparametric BenhrensFisher problem: Asymptotic theory and a smallsample approximation”. Biometrical Journal. Vol. 42(2000): 1725.
 2(1,2)
Neubert, K. and Brunner, E. “A studentized permutation test for the nonparametric BehrensFisher problem”. Computational Statistics and Data Analysis. Vol. 51(2007): 51925204.
Examples
>>> from scipy import stats >>> x1 = [1,2,1,1,1,1,1,1,1,1,2,4,1,1] >>> x2 = [3,3,4,3,1,2,3,1,1,5,4] >>> w, p_value = stats.brunnermunzel(x1, x2) >>> w 3.1374674823029505 >>> p_value 0.0057862086661515377