Given a set of pvalues and a summary statistic S:
S = 2 ∑ \log p,
a pvalue for this statistic can be derived by randomly generating summary statistics [Rhodes,2002]. Therefore, a pvalue is randomly sampled from each contributing study and a random statistic is calculated. The fraction of random statistics greater or equal to S then gives the pvalue.
1 2  fisher.method.perm(pvals, p.corr = c("bonferroni", "BH", "none"),
zero.sub = 1e05, B = 10000, mc.cores = NULL, blinker = 1000)

pvals 
A matrix or data.frame containing the pvalues from the single tests 
p.corr 
Method for correcting the summary pvalues. BH: BenjaminiHochberg (default); Bonferroni's method or no ('none') correction are currently supported. 
zero.sub 
Replacement for pvalues of 0 
B 
Number of random statistics 
mc.cores 
Number of cores used for calculating the permutations. If not

blinker 
An indicator that prints " 
At the moment this function only supports situations were all passed pvalues
are not NA
. We plan on extending this functionality in upcoming versions.
For large data sets and/or large B
we strongly recommend using
the mc.cores
option as the calculation will otherwise be
computationally demanding. This will call the mclapply
function from the parallel package, which you will have to
install in that case.
By default a blinker (a small string "=") is shown after each 1000
rows that were computed. This function allows you to assess the
progress of the analysis. If you don't want to see the blinker set it to NA
.
As log(0)
results in Inf
we replace pvalues of 0 by default with a
small float. If you want to keep them as 0 you have to provide 0
as a parameter in zero.sub
.
Note that only pvalues between 0 and 1 are allowed to be passed to this method.
This method returns a data.frame containing the following columns
S 
The statistic 
num.p 
The number of pvalues used to calculate S 
p.value 
The overall pvalue 
p.adj 
The adjusted pvalue 
Karl Kugler <karl@eigenlab.net>
Rhodes, D. R., (2002). Metaanalysis of microarrays: interstudy validation of gene expression profiles reveals pathway dysregulation in prostate cancer. Cancer research, 62(15), 442733.
1 2 3 4 5 6 7  set.seed(123)
pp < matrix(c(runif(20),c(0.001,0.02,0.03,0.001)), ncol=4)
fisher.method.perm(pp, B=10, blinker=1)
## Not run:
fisher.method.perm(pp, B=10000, mc.cores=3, blinker=1) #use parallel
## End(Not run)

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
Please suggest features or report bugs with the GitHub issue tracker.
All documentation is copyright its authors; we didn't write any of that.