### load BCG vaccine data
data(dat.bcg)
### meta-analysis of the log risk ratios using a random-effects model
res <- rma(ai=tpos, bi=tneg, ci=cpos, di=cneg, slab=paste(author, year),
data=dat.bcg, measure="RR", method="REML")
### several forest plots illustrating the use of various arguments
forest(res, xlab="Log Relative Risk")
forest(res, xlab="Log Relative Risk", order=order(dat.bcg$ablat))
forest(res, transf=exp, alim=c(0,6), steps=4, xlim=c(-8,12),
xlab="Relative Risk", refline=1)
forest(res, atransf=exp, at=log(c(.05,.25,1,4,12)), xlim=c(-8,6),
xlab="Relative Risk (log scale)", order="prec")
forest(res, atransf=exp, at=log(c(.05,.25,1,8)), xlim=c(-14,6),
ylim=c(-1.5,15), xlab="Relative Risk (log scale)", order="prec",
ilab=cbind(dat.bcg$tpos, dat.bcg$tneg, dat.bcg$cpos, dat.bcg$cneg),
ilab.xpos=c(-8,-7,-5,-4), cex=.7)
text(c(-8,-7,-5,-4), y=14.5, c("TB+", "TB-", "TB+", "TB-"), cex=.7)
text(c(-7.5,-4.5), y=15.5, c("Vaccinated", "Control"), cex=.7)
text(c(10), y=15, c("Observed [95% CI]"), cex=.7)
### mixed-effects model with absolute latitude in the model
res <- rma(ai=tpos, bi=tneg, ci=cpos, di=cneg, mods=ablat, slab=paste(author, year),
data=dat.bcg, measure="RR", method="REML")
### forest plots with observed and fitted values
forest(res, xlim=c(-18,10), ylim=c(.5, 15), order="fit", xlab="Log Relative Risk",
ilab=dat.bcg$ablat, ilab.xpos=-6)
text(-6, y=15, c("Absolute
Latitude"))
Run the code above in your browser using DataLab