Search code examples
pythonstatisticsp-valueq-value

Calculating adjusted p-values in Python


So, I've been spending some time looking for a way to get adjusted p-values (aka corrected p-values, q-values, FDR) in Python, but I haven't really found anything. There's the R function p.adjust, but I would like to stick to Python coding, if possible. Is there anything similar for Python?

If this is somehow a bad question, sorry in advance! I did search for answers first, but found none (except a Matlab version)... Any help is appreciated!


Solution

  • It is available in statsmodels.

    http://statsmodels.sourceforge.net/devel/stats.html#multiple-tests-and-multiple-comparison-procedures

    http://statsmodels.sourceforge.net/devel/generated/statsmodels.sandbox.stats.multicomp.multipletests.html

    and some explanations, examples and Monte Carlo http://jpktd.blogspot.com/2013/04/multiple-testing-p-value-corrections-in.html