scikit_posthocs.sign_array

scikit_posthocs.sign_array(p_values: Union[List[T], numpy.ndarray], alpha: float = 0.05) → numpy.ndarray

Significance array

Converts an array with p values to a significance array where 0 is False (not significant), 1 is True (significant), and -1 is for diagonal elements.

Parameters:
  • p_values (Union[List, np.ndarray]) – Any object exposing the array interface and containing p values.
  • alpha (float = 0.05) – Significance level. Default is 0.05.
Returns:

result – Array where 0 is False (not significant), 1 is True (significant), and -1 is for diagonal elements.

Return type:

numpy.ndarray

Examples

>>> p_values = np.array([[ 1.        ,  0.00119517,  0.00278329],
                         [ 0.00119517,  1.        ,  0.18672227],
                         [ 0.00278329,  0.18672227,  1.        ]])
>>> ph.sign_array(p_values)
array([[1, 1, 1],
       [1, 1, 0],
       [1, 0, 1]])