spectral_connectivity.statistics.Benjamini_Hochberg_procedure#

Benjamini_Hochberg_procedure(p_values: ndarray[tuple[int, ...], dtype[floating]], alpha: float = 0.05) ndarray[tuple[int, ...], dtype[bool]][source]#

Control false discovery rate using Benjamini-Hochberg procedure.

Corrects for multiple comparisons and returns significant p-values by controlling the false discovery rate at level alpha using the Benjamini-Hochberg procedure.

Parameters:
  • p_values (NDArray[floating], shape (...,)) – P-values from statistical tests to be corrected.

  • alpha (float, default=0.05) – Expected proportion of false positive tests (false discovery rate).

Returns:

is_significant – Boolean array same shape as p_values indicating whether the null hypothesis has been rejected (True) or failed to reject (False).

Return type:

NDArray[bool], shape (…,)

Examples

>>> import numpy as np
>>> p_vals = np.array([0.001, 0.02, 0.04, 0.3, 0.8])
>>> significant = Benjamini_Hochberg_procedure(p_vals, alpha=0.05)
>>> significant
array([ True,  True, False, False, False])