The meta-analysis is conducted to increase the statistical power by combining evidences (e.g., effect sizes and p-values) obtained from multiple experiments. The p-value combination has been widely used for meta-analysis when effect sizes are not available. metapro is a CRAN R package that provides functions for p-value combinations. There are four functions including
The original Fisher's method and (weighted) Z-method have been commonly used for p-value combination. In particular, the Z-method is effective when a feature is associated with most of the cohorts. However, this attributes is disadvantageous detecting partially associated patterns (e.g., detection of African-specific features in trans-ethnic analysis).Therefore, in this study, we designed the ordmeta and wFisher method that work effectively in those situations. The detailed formulas are described in our paper.
Prerequisites
After all prerequisites are installed, open R and install the metapro package by typing
install.packages('devtools') # install 'devtools'
library(devtools)
install_github('unistbig/metapro', INSTALL_opts=c("--no-multiarch"))
library(metapro) # Load metapro package
or
install.packages('metapro', INSTALL_opts=c("--no-multiarch"))
library(metapro)
Tip: Dealing with Errors
In most cases, installation errors come from 1) encoding problem and 2) JAVA environment variable settings.
So, please try followings.
Encoding error
On Windows,
Sys.setlocale('LC_ALL','C')
and install the package again.
Error from JAVA setting
Most error will occur with rJAVA. In this case, please
Sys.setenv(JAVA_HOME='C:\\Program Files\\Java\\jdk1.8.0_211")
Sys.setenv(CLASSPATH="C:\\Program Files\\Java\\jdk1.8.0_211\\jre\\lib\\ext")
Sys.setenv(RPATH="C:\\Program Files\\R\\R-3.6.0\\bin\\x64")
If you are Linux or Mac OSX user, type following on terminal and re-open the R console after setting the environment variables.
sudo R CMD javareconf
Next, check whether rJAVA is installed correctly, and try installing metapro again.
install.packages('rJava')
library(rJava)
wFisher is designed to assign weights to each experiment based on the sample size.
wFisher(p=c(0.01, 0.02, 0.8, 0.25), weight = c(200, 500, 100, 80), is.onetail=FALSE, eff.sign = c(1,1,1,-1))
will return
$p
[1] 0.003060523
$overall.eff.direction
[1] "+"
| Arguments | |
|---|---|
| p | A numeric vector of p-values |
| is.onetail | Logical. If set TRUE, p-values are combined without considering the direction of effect, and vice versa. Default: TRUE. |
| weight | A numeric vector of weight or sample size for each experiment. Note! If no weight option is given, the original Fisher method is performed. |
| eff.sign | A vector of signs of effects. It works when is.onetail = FALSE |
| Value | |
|---|---|
| p | Combined p-value |
| overall.eff.direction | The direction of combined effects. |
Weighted Z-method. This function has been modified from sumz function in metap package.
wZ(p=c(0.01, 0.02, 0.8, 0.25), weight = c(200, 500, 100, 80), is.onetail=FALSE, eff.sign = c(1,1,1,-1))
will return
[1] 0.001798156
$overall.eff.direction
[1] "+"
$sumz
[1] 2.911558
| Arguments | |
|---|---|
| p | A numeric vector of p-values |
| is.onetail | Logical. If set TRUE, p-values are combined without considering the direction of effect, and vice versa. Default: TRUE. |
| weight | A numeric vector of weight or sample size for each experiment. Note! If no weight option is given, the Stouffer's method is performed. |
| eff.sign | A vector of signs of effects. It works when is.onetail = FALSE |
| Value | |
|---|---|
| p | Combined p-value |
| overall.eff.direction | The direction of combined effects. |
| sumz | Transformed sum of z-values |
Lancaster's procedure - the generalized version Fisher's method
lancaster(p=c(0.01, 0.02, 0.8, 0.25), weight = c(200, 500, 100, 80), is.onetail=FALSE, eff.sign = c(1,1,1,-1))
will return
$p
[1] 0.005694935
$overall.eff.direction
[1] "+"
| Arguments | |
|---|---|
| p | A numeric vector of p-values |
| is.onetail | Logical. If set TRUE, p-values are combined without considering the direction of effect, and vice versa. Default: TRUE. |
| weight | A numeric vector of weight or sample size for each experiment. Required! |
| eff.sign | A vector of signs of effects. It works when is.onetail = FALSE |
| Value | |
|---|---|
| p | Combined p-value |
| overall.eff.direction | The direction of combined effects. |
Sora Yoon: ysora90@gmail.com
Department of Biological Sciences, UNIST