Standard approaches to meta-analysis assumes that effect sizes are statistically independent. Here we provide methods for fixed and random effects meta-analysis when the correlation between effect sizes are known.

### Fixed effects meta-analysis

LS() implements fixed effect meta-analysis for correlated test statistics using method of Lin and Sullivan (2009). By default, correlation is set to identity matrix to for independent test statistics.

### Random effects meta-analysis

RE2C() implements random effect meta-analysis for correlated test statistics that jointly tests deviation of the mean from zero as well as effect size heterogenity. This method uses the RE2 method of Han and Eskin (2011), or RE2 for correlated test statistics from Han et al. (2016). By default, correlation is set to identity matrix to for independent test statistics. (In addition, this function computes the two step RE2C method of Lee, Eskin, and Han (2017) to further test for heterogenity in effect size after applying a fixed effect test.)

• stat1: statistic testing effect mean

• stat2: statistic testing effect heterogeneity

• RE2Cp: RE2 p-value accounting for correlelation between tests. (This is the p-value appropriate for most questions)

• RE2Cp.twoStep: two step RE2C test after fixed effect test. Only evaluated if twoStep==TRUE. (not typically used)

• QE: test statistic for the test of (residual) heterogeneity

• QEp: p-value for the test of (residual) heterogeneity

• Isq: I^2 statistic

QE, QEp and Isq are only evaluted if correlation is diagonal

### Examples

library(remaCor)
library(metafor)

# Generate effects
library(mvtnorm)
library(clusterGeneration )

n = 4
Sigma = cov2cor(genPositiveDefMat(n)\$Sigma)
beta = t(rmvnorm(1, rep(0, n), Sigma))
stders = rep(.1, n)

# Standard fixed effects meta-analysis
# of independent effects with metafor pacakge
rma( beta, sei=stders, method="FE")
##
## Fixed-Effects Model (k = 4)
##
## I^2 (total heterogeneity / total variability):   98.73%
## H^2 (total variability / sampling variability):  78.58
##
## Test for Heterogeneity:
## Q(df = 3) = 235.7269, p-val < .0001
##
## Model Results:
##
## estimate      se     zval    pval    ci.lb   ci.ub
##  -0.0525  0.0500  -1.0510  0.2933  -0.1505  0.0455
##
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# Standard random effects meta-analysis
# of independent effects with metafor pacakge
rma( beta, sei=stders, method="REML")
##
## Random-Effects Model (k = 4; tau^2 estimator: REML)
##
## tau^2 (estimated amount of total heterogeneity): 0.7758 (SE = 0.6416)
## tau (square root of estimated tau^2 value):      0.8808
## I^2 (total heterogeneity / total variability):   98.73%
## H^2 (total variability / sampling variability):  78.58
##
## Test for Heterogeneity:
## Q(df = 3) = 235.7269, p-val < .0001
##
## Model Results:
##
## estimate      se     zval    pval    ci.lb   ci.ub
##  -0.0525  0.4432  -0.1186  0.9056  -0.9212  0.8161
##
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# Run fixed effects meta-analysis, assume identity correlation
# Use Lin-Sullivan method
LS( beta, stders)
##          beta   se         p
## 1 -0.05254753 0.05 0.2932813
# Run fixed effects meta-analysis, accounting for correlation
# Use Lin-Sullivan method
LS( beta, stders, Sigma)
##         beta        se            p
## 1 -0.1528898 0.0463243 0.0009653879
# Run random effects meta-analysis, assume identity correlation
RE2C( beta, stders)
##      stat1    stat2        RE2Cp RE2Cp.twoStep       QE          QEp      Isq
## 1 1.104497 215.4213 2.886797e-48            NA 235.7269 7.989831e-51 98.72734
# Run random effects meta-analysis, accounting for correlation
RE2C( beta, stders, Sigma)
##     stat1    stat2        RE2Cp RE2Cp.twoStep QE QEp Isq
## 1 10.8928 181.5106 5.370929e-43            NA NA  NA  NA
##     stat1    stat2        RE2Cp RE2Cp.twoStep QE QEp Isq
## 1 10.8928 181.5106 5.370929e-43            NA NA  NA  NA

# Session info

sessionInfo()
## R version 4.2.0 (2022-04-22)
## Platform: x86_64-apple-darwin19.6.0 (64-bit)
## Running under: macOS Catalina 10.15.7
##
## Matrix products: default
## BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
## LAPACK: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib
##
## locale:
## [1] C/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
##
## attached base packages:
## [1] grid      stats     graphics  grDevices utils     datasets  methods
## [8] base
##
## other attached packages:
##  [4] Matrix_1.5-1            remaCor_0.0.11          reshape2_1.4.4
##  [7] ggplot2_3.4.0           clusterGeneration_1.3.7 MASS_7.3-58.1
## [10] RUnit_0.4.32
##
## loaded via a namespace (and not attached):
##  [1] tidyselect_1.2.0 xfun_0.34        bslib_0.4.0      lattice_0.20-45
##  [5] colorspace_2.0-3 vctrs_0.5.0      generics_0.1.3   htmltools_0.5.3
##  [9] yaml_2.3.6       utf8_1.2.2       rlang_1.0.6      jquerylib_0.1.4
## [13] pillar_1.8.1     glue_1.6.2       withr_2.5.0      DBI_1.1.3
## [17] lifecycle_1.0.3  plyr_1.8.7       stringr_1.4.1    munsell_0.5.0
## [21] gtable_0.3.1     codetools_0.2-18 evaluate_0.18    knitr_1.40
## [25] fastmap_1.1.0    fansi_1.0.3      Rcpp_1.0.9       scales_1.2.1
## [29] cachem_1.0.6     jsonlite_1.8.3   digest_0.6.30    stringi_1.7.8
## [33] dplyr_1.0.10     rbibutils_2.2.9  mathjaxr_1.6-0   Rdpack_2.4
## [37] cli_3.4.1        tools_4.2.0      magrittr_2.0.3   sass_0.4.2
## [41] tibble_3.1.8     pkgconfig_2.0.3  assertthat_0.2.1 rmarkdown_2.17
## [45] R6_2.5.1         nlme_3.1-160     compiler_4.2.0

## References

Han, Buhm, Dat Duong, Jae Hoon Sul, Paul IW de Bakker, Eleazar Eskin, and Soumya Raychaudhuri. 2016. “A General Framework for Meta-Analyzing Dependent Studies with Overlapping Subjects in Association Mapping.” Human Molecular Genetics 25 (9): 1857–66. https://doi.org/10.1093/hmg/ddw049.
Han, Buhm, and Eleazar Eskin. 2011. “Random-Effects Model Aimed at Discovering Associations in Meta-Analysis of Genome-Wide Association Studies.” The American Journal of Human Genetics 88 (5): 586–98. https://doi.org/10.1016/j.ajhg.2011.04.014.
Lee, CH, Eleazar Eskin, and Buhm Han. 2017. “Increasing the Power of Meta-Analysis of Genome-Wide Association Studies to Detect Heterogeneous Effects.” Bioinformatics 33 (14): i379–88. https://doi.org/10.1093/bioinformatics/btx242.
Lin, Dan-Yu, and Patrick F Sullivan. 2009. “Meta-Analysis of Genome-Wide Association Studies with Overlapping Subjects.” The American Journal of Human Genetics 85 (6): 862–72. https://doi.org/10.1016/j.ajhg.2009.11.001.