scikit_posthocs.test_osrt

scikit_posthocs.test_osrt(data: Union[List, numpy.ndarray, pandas.core.frame.DataFrame], val_col: Optional[str] = None, group_col: Optional[str] = None, sort: bool = False) Tuple[float, float, int]

Hayter’s one-sided studentised range test (OSRT)

Tests a hypothesis against an ordered alternative for normal data with equal variances 1.

Parameters
  • data (Union[List, numpy.ndarray, DataFrame]) – An array, any object exposing the array interface or a pandas DataFrame with data values.

  • 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, int]

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')