nispace.stats.misc.mc_correction

nispace.stats.misc.mc_correction(p_array, alpha=0.05, method='fdr_bh', how='array', dtype=None)[source]

Multiple-comparison correction via statsmodels.stats.multitest.multipletests.

Plain numpy/pandas (no numba). Used in api.py as the default (non-permutation-based) mc_method option.

Parameters:
  • p_array (array-like, DataFrame, or Series) – Uncorrected p-values, 1D or 2D.

  • alpha (float, default=0.05) – Significance threshold for the reject output.

  • method (str, default="fdr_bh") – Correction method name forwarded to multipletests (e.g. "fdr_bh", "bonferroni", "holm", …).

  • how (str, default="array") – Correction scope for 2D input: "array"/"a"/"arr" (flatten and correct across the whole array), "cols"/"c"/… (correct each column independently), or "rows"/"r"/… (each row independently). Ignored (treated as whole-array) for 1D input.

  • dtype (optional) – Cast the DataFrame/Series outputs to this dtype.

Returns:

pcor, reject – Corrected p-values and boolean rejection mask.

Return type:

same type as p_array