esda.fdr¶
-
esda.fdr(pvalues, alpha=
0.05)[source]¶ Calculate the p-value cut-off to control for the false discovery rate (FDR) for multiple testing.
If by controlling for FDR, all of n null hypotheses are rejected, the conservative Bonferroni bound (alpha/n) is returned instead.
- Parameters:¶
- Returns:¶
Adjusted criterion for rejecting the null hypothesis. If by controlling for FDR, all of n null hypotheses are rejected, the conservative Bonferroni bound (alpha/n) is returned.
- Return type:¶
Notes
For technical details see [Benjamini and Yekutieli, 2001] and [de Castro and Singer, 2006].
Examples
>>> import libpysal >>> import numpy as np >>> np.random.seed(10) >>> w = libpysal.io.open(libpysal.examples.get_path("stl.gal")).read() >>> f = libpysal.io.open(libpysal.examples.get_path("stl_hom.txt")) >>> y = np.array(f.by_col['HR8893']) >>> from esda import Moran_Local >>> from esda import fdr >>> lm = Moran_Local( ... y, ... w, ... transformation="r", ... permutations=999, ... seed=12345, ... alternative='two-sided', ... ) >>> fdr(lm.p_sim, 0.1) 0.001282051282051282Return the conservative Bonferroni bound
>>> fdr(lm.p_sim, 0.05) 0.000641025641025641