scikit_posthocs.test_osrt

scikit_posthocs.test_osrt(a: Union[List[T], numpy.ndarray, pandas.core.frame.DataFrame], val_col: str = None, group_col: str = None, sort: bool = False)

Hayter’s one-sided studentised range test (OSRT) against an ordered alternative for normal data with equal variances [1].

Parameters:
  • a (Union[List, numpy.ndarray, DataFrame]) – An array, any object exposing the array interface or a pandas DataFrame.
  • val_col (str = None) – Name of a DataFrame column that contains dependent variable values (test or response variable). Values should have a non-nominal scale. Must be specified if a is a pandas DataFrame object.
  • group_col (str = None) – Name of a DataFrame column that contains independent variable values (grouping or predictor variable). Values should have a nominal scale (categorical). Must be specified if a is a pandas DataFrame object.
  • sort (bool = False) – If True, sort data by block and group columns.
Returns:

P value, statistic, and number of degrees of freedom.

Return type:

Tuple[float, float, float]

Notes

P values are computed from the Tukey distribution.

References

[1]Hayter, A.J.(1990) A One-Sided Studentised Range Test for Testing Against a Simple Ordered Alternative, Journal of the American Statistical Association, 85, 778-785.

Examples

>>> import scikit_posthocs as sp
>>> import pandas as pd
>>> x = pd.DataFrame({"a": [1,2,3,5,1], "b": [12,31,54,62,12], "c": [10,12,6,74,11]})
>>> x = x.melt(var_name='groups', value_name='values')
>>> sp.test_osrt(x, val_col='values', group_col='groups')