⇤ ← Revision 1 as of 20080425 11:41:43
503
Comment:

689

Deletions are marked like this.  Additions are marked like this. 
Line 1:  Line 1: 
= R code for combining pvalues using Fisher's method =  = R code for combining pvalues using Bailey and Gribskov (1998) method = 
Line 32:  Line 32: 
(I hope to improve this so that only the pvals vector needs to be entered for each run with the check to see if the pvalue vector is empty done less obtrusively!) 
R code for combining pvalues using Bailey and Gribskov (1998) method
pfish < function(p) { t < prod(p) x < log(prod(p)) n < length(p) v < c(1:n1) a < t*(x^v)/factorial(v) pf < sum(a) return(pf) }
Running this inputting a list of pvalues on vector pvals
pvals < c(0.1,0.01,0.01,0.7,0.3,0.1) pl < NA pl < length(pvals) { if (is.na(pl)) { res < "There was an empty array of pvalues"} else res < pfish(pvals) } print(res)
we get
[1] 0.002148704
(I hope to improve this so that only the pvals vector needs to be entered for each run with the check to see if the pvalue vector is empty done less obtrusively!)