### load BCG vaccine data
data(dat.bcg)
### meta-analysis of the log relative risks using a random-effects model
res <- rma(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat.bcg)
### confidence interval for the total amount of heterogeneity
confint(res)
### mixed-effects model with absolute latitude in the model
res <- rma(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg,
mods = ~ ablat, data=dat.bcg)
### confidence interval for the residual amount of heterogeneity
confint(res)
### load data
dat <- get(data(dat.konstantopoulos2011))
### multilevel random-effects model
res <- rma.mv(yi, vi, random = ~ 1 | district/school, data=dat)
### profile plots and confidence intervals for the variance components
## Not run:
# par(mfrow=c(2,1))
# profile(res, sigma2=1)
# abline(h=logLik(res) - qchisq(.95, df=1)/2, lty="dotted")
# sav <- confint(res, sigma2=1)
# sav
# abline(v=sav$random[1,2:3], lty="dotted")
# profile(res, sigma2=2)
# abline(h=logLik(res) - qchisq(.95, df=1)/2, lty="dotted")
# sav <- confint(res, sigma2=2)
# sav
# abline(v=sav$random[1,2:3], lty="dotted")## End(Not run)
### multivariate parameterization of the model
res <- rma.mv(yi, vi, random = ~ factor(school) | district, data=dat)
### profile plots and confidence intervals for the variance component and correlation
## Not run:
# par(mfrow=c(2,1))
# profile(res, tau2=1)
# abline(h=logLik(res) - qchisq(.95, df=1)/2, lty="dotted")
# sav <- confint(res, tau2=1)
# sav
# abline(v=sav$random[1,2:3], lty="dotted")
# profile(res, rho=1)
# abline(h=logLik(res) - qchisq(.95, df=1)/2, lty="dotted")
# sav <- confint(res, rho=1)
# sav
# abline(v=sav$random[1,2:3], lty="dotted")## End(Not run)
Run the code above in your browser using DataLab