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:
-
If by controlling for FDR, all of n null hypotheses
are rejected, the conservative Bonferroni bound (alpha/n)
is returned.
Notes
For technical details see [BY01] and [dCS06].
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.moran import Moran_Local
>>> from esda import fdr
>>> lm = Moran_Local(y, w, transformation = "r", permutations = 999)
>>> fdr(lm.p_sim, 0.1)
0.002564102564102564
>>> fdr(lm.p_sim, 0.05) #return the conservative Bonferroni bound
0.000641025641025641