Skip to content

Instantly share code, notes, and snippets.

@jtprince
Created December 11, 2014 23:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jtprince/2af3390a33764bf32506 to your computer and use it in GitHub Desktop.
Save jtprince/2af3390a33764bf32506 to your computer and use it in GitHub Desktop.
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