data(Fleiss1993cont)
# Add some (fictitious) grouping variables:
Fleiss1993cont$age <- c(55, 65, 55, 65, 55)
Fleiss1993cont$region <- c("Europe", "Europe", "Asia", "Asia", "Europe")
m1 <- metacont(n.psyc, mean.psyc, sd.psyc, n.cont, mean.cont, sd.cont,
data = Fleiss1993cont, sm = "MD")
if (FALSE) {
# Error due to wrong ordering of arguments (order has changed in
# R package meta, version 3.0-0)
#
try(metareg(~ region, m1))
try(metareg(~ region, data = m1))
# Warning as no information on covariate is available
#
metareg(m1)
}
# Do meta-regression for covariate region
#
mu2 <- update(m1, subgroup = region, tau.common = TRUE, common = FALSE)
metareg(mu2)
# Same result for
# - tau-squared
# - test of heterogeneity
# - test for subgroup differences
# (as argument 'tau.common' was used to create mu2)
#
mu2
metareg(mu2, intercept = FALSE)
metareg(m1, region)
# Different result for
# - tau-squared
# - test of heterogeneity
# - test for subgroup differences
# (as argument 'tau.common' is - by default - FALSE)
#
mu1 <- update(m1, subgroup = region)
mu1
# Generate bubble plot
#
bubble(metareg(mu2))
# Do meta-regression with two covariates
#
metareg(mu1, region + age)
# Do same meta-regressions using formula notation
#
metareg(m1, ~ region)
metareg(mu1, ~ region + age)
# Do meta-regression using REML method and print intermediate
# results for iterative estimation algorithm; furthermore print
# results with three digits.
#
metareg(mu1, region, method.tau = "REML",
control = list(verbose = TRUE), digits = 3)
# Use Hartung-Knapp method
#
mu3 <- update(mu2, method.random.ci = "HK")
mu3
metareg(mu3, intercept = FALSE)
Run the code above in your browser using DataLab