scikit_posthocs.posthoc_dunnett
- scikit_posthocs.posthoc_dunnett(a: list | ndarray | DataFrame, val_col: str = None, group_col: str = None, control: str = None, alternative: Literal['two-sided', 'less', 'greater'] = 'two-sided', sort: bool = False, to_matrix: bool = True) Series | DataFrame
Dunnett’s test [1, 2, 3] for multiple comparisons against a control group, used after parametric ANOVA. The control group is specified by the control parameter.
- Parameters:
a (array_like or pandas DataFrame object) – An array, any object exposing the array interface or a pandas DataFrame. Array must be two-dimensional.
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.
control (str, optional) – Name of the control group within the group_col column. Values should have a nominal scale (categorical). Must be specified if a is a pandas DataFrame.
alternative (['two-sided', 'less', or 'greater'], optional) – Whether to get the p-value for the one-sided hypothesis (‘less’ or ‘greater’) or for the two-sided hypothesis (‘two-sided’). Defaults to ‘two-sided’.
sort (bool, optional) – Specifies whether to sort DataFrame by group_col or not. Recommended unless you sort your data manually.
to_matrix (bool, optional) – Specifies whether to return a DataFrame or a Series. If True, a DataFrame is returned with some NaN values since it’s not pairwise comparison. Default is True.
- Returns:
result – P values.
- Return type:
pandas.Series or pandas.DataFrame
References