I am using the
metafor package to conduct a meta-analysis. I’d like to test whether the overall effect size is significantly different from zero when controlling for a moderator. For a minimal working example, I am using the
dat.bcg dataset provided with the
metafor package, which contains 13 effect size estimates and corresponding sampling variances of the effect of BCG vaccination on the prevention of tuberculosis. Here are the steps I take:
#Load package and dataset library("metafor") data("dat.bcg", package = "metafor")
1) Once these 13 effect sizes were converted to the same metric,
#Calculate effect sizes on common metric dat <- escalc(measure = "RR", ai = tpos, bi = tneg, ci = cpos, di = cneg, data = dat.bcg, append = TRUE)
2) I fitted a fixed-effects model examining the magnitude of the effect of vaccination on prevention of tuberculosis (with
yi = observed outcomes and
vi = sampling variance), and finding a significant average effect size estimate with a substantial amount of heterogeneity:
# Fit fixed-effect model res <- rma(yi, vi, data = dat, method="FE")
3) I then moved on to a moderator analysis. Using the following code, I examined if a continuous variable (
ablat, representing the absolute latitude of the study location) significantly moderated the average effect size estimate of the effect of vaccination on the prevention of tuberculosis.
# Examine continuous moderator (ablat) res <- rma(yi, vi, mods = ~ ablat, data = dat, method = "REML")
I am further interested if the average effect size estimate remains significant when controlling for this continuous moderator (
ablat). In other words, I’m interested in whether there remains an effect of vaccination on the prevention of tuberculosis when controlling for the covariate (i.e., examining whether vaccination is still effective when controlling for study location). Is this possible? Any help would be appreciated.