scikit_posthocs.posthoc_scheffe

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

Scheffe’s all-pairs comparisons test for normally distributed data with equal group variances. For all-pairs comparisons in an one-factorial layout with normally distributed residuals and equal variances Scheffe’s test can be performed with parametric ANOVA 1, 2, 3.

A total of m = k(k-1)/2 hypotheses can be tested.

Parameters
  • a (Union[list, np.ndarray, DataFrame]) – An array, any object exposing the array interface or a pandas DataFrame.

  • val_col (str, optional) – 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, optional) – 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, optional) – If True, sort data by block and group columns.

Returns

result – P values.

Return type

pandas.DataFrame

Notes

The p values are computed from the F-distribution.

References

1

J. Bortz (1993) Statistik für Sozialwissenschaftler. 4. Aufl., Berlin: Springer.

2
  1. Sachs (1997) Angewandte Statistik, New York: Springer.

3

H. Scheffe (1953) A Method for Judging all Contrasts in the Analysis of Variance. Biometrika 40, 87-110.

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.posthoc_scheffe(x, val_col='values', group_col='groups')