scikit_posthocs.posthoc_miller_friedman

scikit_posthocs.posthoc_miller_friedman(a: Union[list, numpy.ndarray, pandas.core.frame.DataFrame], y_col: str = None, block_col: str = None, group_col: str = None, melted: bool = False, sort: bool = False) → pandas.core.frame.DataFrame

Miller´s All-Pairs Comparisons Test for Unreplicated Blocked Data. The p-values are computed from the chi-square distribution [1], [2], [3].

Parameters:
  • a (array_like or pandas DataFrame object) –

    An array, any object exposing the array interface or a pandas DataFrame.

    If melted is set to False (default), a is a typical matrix of block design, i.e. rows are blocks, and columns are groups. In this case you do not need to specify col arguments.

    If a is an array and melted is set to True, y_col, block_col and group_col must specify the indices of columns containing elements of correspondary type.

    If a is a Pandas DataFrame and melted is set to True, y_col, block_col and group_col must specify columns names (strings).

  • y_col (str or int) – Must be specified if a is a pandas DataFrame object. Name of the column that contains y data.
  • block_col (str or int) – Must be specified if a is a pandas DataFrame object. Name of the column that contains blocking factor values.
  • group_col (str or int) – Must be specified if a is a pandas DataFrame object. Name of the column that contains treatment (group) factor values.
  • melted (bool, optional) – Specifies if data are given as melted columns “y”, “blocks”, and “groups”.
  • sort (bool, optional) – If True, sort data by block and group columns.
Returns:

result – P values.

Return type:

pandas.DataFrame

Notes

For all-pairs comparisons in a two factorial unreplicated complete block design with non-normally distributed residuals, Miller’s test can be performed on Friedman-type ranked data.

References

[1]J. Bortz J, G. A. Lienert, K. Boehnke (1990), Verteilungsfreie Methoden in der Biostatistik. Berlin: Springerself.
[2]R. G. Miller Jr. (1996), Simultaneous statistical inference. New York: McGraw-Hill.
[3]E. L. Wike (2006), Data Analysis. A Statistical Primer for Psychology Students. New Brunswick: Aldine Transaction.

Examples

>>> x = np.array([[31,27,24],[31,28,31],[45,29,46],[21,18,48],[42,36,46],[32,17,40]])
>>> sp.posthoc_miller_friedman(x)