eelbrain.test.MannWhitneyU

class eelbrain.test.MannWhitneyU(y, x, c1=None, c0=None, match=None, sub=None, data=None, tail=0, continuity=True)[source]

Mann-Whitney U-test (non-parametric independent measures test)

The test data can be specified in two forms:

  • In long form, with y supplying the data, x specifying condition for each case.

  • With y and x supplying data for the two conditions.

Parameters:
  • y (Var | str) – Dependent variable. Alternatively, the first of two variables that are compared.

  • x (Factor | Interaction | NestedEffect | str | Var) – Model containing the cells which should be compared. Alternatively, the second of two varaibles that are compared.

  • c1 (str | tuple[str, ...]) – Test condition (cell of x). c1 and c0 can be omitted if x only contains two cells, in which case cells will be used in alphabetical order.

  • c0 (str | tuple[str, ...]) – Control condition (cell of x).

  • match (Factor | Interaction | NestedEffect | str) – Units within which measurements are related (e.g. ‘subject’ in a within-subject comparison). If match is unspecified, it is assumed that y and x are two measurements with matched cases.

  • sub (Var | ndarray | str) – Perform the test with a subset of the data.

  • data (Dataset) – If a Dataset is specified, all data-objects can be specified as names of Dataset variables.

  • tail (int) – Which tail of the t-distribution to consider: 0: both (two-tailed, default); 1: upper tail (one-tailed); -1: lower tail (one-tailed).

  • continuity (bool) – Continuity correction (default True).

u

Mann-Whitney U statistic.

Type:

float

p

P-value.

Type:

float

tail

Tailedness of the p value (0, 1 or -1).

Type:

int

See also

TTestRelated

parametric alternative

Notes

Based on scipy.stats.mannwhitneyu().

Methods