scikit_posthocs.sign_table

scikit_posthocs.sign_table(p_values: Union[List[T], numpy.ndarray, pandas.core.frame.DataFrame], lower: bool = True, upper: bool = True) → Union[pandas.core.frame.DataFrame, numpy.ndarray]

Significance table.

Returns table that can be used in a publication. P values are replaced with asterisks: * - p < 0.05, ** - p < 0.01, *** - p < 0.001.

Parameters:
  • p_values (Union[List, np.ndarray, DataFrame]) – Any object exposing the array interface and containing p values.
  • lower (bool) – Defines whether to return the lower triangle.
  • upper (bool) – Defines whether to return the upper triangle.
Returns:

result – P values masked with asterisks.

Return type:

Union[DataFrame, np.ndarray]

Examples

>>> p_values = np.array([[-1.        ,  0.00119517,  0.00278329],
                  [ 0.00119517, -1.        ,  0.18672227],
                  [ 0.00278329,  0.18672227, -1.        ]])
>>> ph.sign_table(p_values)
array([['-', '**', '**'],
       ['**', '-', 'NS'],
       ['**', 'NS', '-']], dtype=object)