# Print results with more significant digits and do not show confidence
# intervals for tau^2 and tau
oldset <- settings.meta(digits = 6, digits.stat = 4, digits.pval = 6,
digits.Q = 6, digits.I2 = 4, digits.H = 4,
print.tau2.ci = FALSE, print.tau.ci = FALSE)
oldopts <- options(width = 120)
data(Fleiss1993bin)
# Mantel-Haenszel method
m1 <- metabin(d.asp, n.asp, d.plac, n.plac, data = Fleiss1993bin,
studlab = paste(study, year), sm = "OR")
# Peto method
m2 <- update(m1, method = "Peto")
# Inverse variance method (only common effect model)
m3 <- update(m2, method = "Inverse", random = FALSE)
# Merge results from MH and Peto method
# - show individual results for MH method
# (as this is the first meta-analysis)
# - keep all additional information from Peto meta-analysis (i.e.,
# weights, Q statistic and I2 statistic)
m12 <- metamerge(m1, m2,
label1 = "REML", label2 = "REML-Peto",
label1.common = "MH", label2.common = "Peto",
text.common1 = "Mantel-Haenszel method",
text.common2 = "Peto method",
text.w.random1 = "REML", text.w.random2 = "REML-Peto",
hetlabel1 = "MH/IV", hetlabel2 = "Peto",
keep = TRUE)
# Add common effect results from inverse variance method
# - keep weights from IV meta-analysis
# - Q and I2 statistic are identical for sm = "MH" and sm = "Inverse"
# as inverse variance method is used for sm = "MH" under random
# effects model
m123 <- metamerge(m12, m3,
label2 = "IV",
text.common2 = "Inverse variance method",
keep.w = TRUE)
summary(m123)
if (FALSE) {
forest(m123, digits = 6)
# Merge results (show individual results for Peto method)
m21 <- metamerge(m2, m1,
label1 = "REML-Peto", label2 = "REML",
label1.common = "Peto", label2.common = "MH",
hetlabel1 = "Peto", hetlabel2 = "MH/IV",
text.common1 = "Peto method",
text.common2 = "Mantel-Haenszel method",
keep = TRUE)
# Add results from inverse variance method
# - keep weights from IV meta-analysis
# - Q and I2 statistic are identical for sm = "MH" and sm = "Inverse"
# as inverse variance method is used for sm = "MH" under random
# effects model
m213 <- metamerge(m21, m3,
label2 = "IV",
text.common2 = "Inverse variance method",
keep.w = TRUE)
summary(m213)
# Random effects method using ML estimator for between-study variance tau2
m4 <- update(m1, common = FALSE, method.tau = "ML")
# Use DerSimonian-Laird estimator for tau2
m5 <- update(m4, method.tau = "DL")
# Use Paule-Mandel estimator for tau2
m6 <- update(m4, method.tau = "PM")
# Merge random effects results for ML and DL estimators
# - keep weights for DL estimator (which are different from ML)
m45 <- metamerge(m4, m5, label1 = "ML", label2 = "DL",
text.w.random1 = "RE-ML", text.w.random2 = "RE-DL", keep.w = TRUE)
summary(m45)
# Add results for PM estimator
# - keep weights
m456 <- metamerge(m45, m6, label2 = "PM",
text.w.random2 = "RE-PM", keep.w = TRUE)
summary(m456)
m123456 <- metamerge(m123, m456)
m123456
# Use Hartung-Knapp confidence intervals
# - do not keep information on Q, I2 and weights
m7 <- update(m4, method.random.ci = "HK",
text.random = "Hartung-Knapp method")
m8 <- update(m5, method.random.ci = "HK",
text.random = "Hartung-Knapp method")
m9 <- update(m6, method.random.ci = "HK",
text.random = "Hartung-Knapp method")
# Merge results for Hartung-Knapp method (with REML and DL estimator)
# - RE weights for REML estimator are shown
m78 <- metamerge(m7, m8, label1 = "ML", label2 = "DL")
summary(m78)
m789 <- metamerge(m78, m9, label2 = "PM")
summary(m789)
# Merge everything
m1to9 <- metamerge(metamerge(m123, m456, keep.w = TRUE), m789)
summary(m1to9)
m10 <- update(m1, method = "GLMM")
m.all <- metamerge(m1to9, m10, keep.Q = TRUE,
label2 = "GLMM", taulabel2 = "ML-GLMM")
summary(m.all)
forest(m.all, layout = "JAMA")
forest(m.all, details = TRUE)
}
settings.meta(oldset)
options(oldopts)
Run the code above in your browser using DataLab