Created
December 11, 2014 23:11
-
-
Save jtprince/2af3390a33764bf32506 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scipy.stats as sts | |
from math import log | |
def fisher_combine_p_values(pvalues): | |
degrees_freedom = 2*len(pvalues) | |
summed = sum(-2*log(pval) for pval in pvalues) | |
return 1.0 - sts.chi2.cdf(summed, degrees_freedom) | |
#print(fisher_combine_p_values( [0.05, 0.05] )) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment