{ } Raw JSON

bundles / scipy 1.17.1 / scipy / stats / _mstats_basic / brunnermunzel

function

scipy.stats._mstats_basic:brunnermunzel

source: /scipy/stats/_mstats_basic.py :3558

Signature

def   brunnermunzel ( x y alternative = two-sided distribution = t )

Summary

Compute the Brunner-Munzel test on samples x and y.

Extended Summary

Any missing values in x and/or y are discarded.

The Brunner-Munzel 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 Wilcoxon-Mann-Whitney'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, y : array_like

Array of samples, should be one-dimensional.

alternative : 'less', 'two-sided', or 'greater', optional

Whether to get the p-value for the one-sided hypothesis ('less' or 'greater') or for the two-sided hypothesis ('two-sided'). Defaults value is 'two-sided' .

distribution : 't' or 'normal', optional

Whether to get the p-value by t-distribution or by standard normal distribution. Defaults value is 't' .

Returns

statistic : float

The Brunner-Munzer W statistic.

pvalue : float

p-value assuming an t distribution. One-sided or two-sided, depending on the choice of alternative and distribution.

Notes

For more details on brunnermunzel, see scipy.stats.brunnermunzel.

Examples

from scipy.stats.mstats import brunnermunzel
import numpy as np
x1 = [1, 2, np.nan, np.nan, 1, 1, 1, 1, 1, 1, 2, 4, 1, 1]
x2 = [3, 3, 4, 3, 1, 2, 3, 1, 1, 5, 4]
brunnermunzel(x1, x2)

See also

mannwhitneyu

Mann-Whitney rank test on two samples.

Aliases

  • scipy.stats._mstats_basic.brunnermunzel