The metafor Package

A Meta-Analysis Package for R

User Tools

Site Tools


plots:cumulative_forest_plot

This is an old revision of the document!


Table of Contents

Cumulative Forest Plot

Description

A cumulative meta-analysis describes the accumulation of evidence (e.g., about the effectiveness of a particular treatment or intervention) as the available estimates are added to the analysis in (typically) chronological order (Chalmers & Lau, 1993; Lau et al., 1995). After fitting a model, for example with the rma() function, a cumulative meta-analysis can be conducted with the cumul() function. The results obtained that way can then be passed to the forest() function, which will draw a cumulative forest plot.

Plot

Code

library(metafor)
 
### decrease margins so the full space is used
par(mar=c(4,4,1,2))
 
### calculate (log) risk ratios and corresponding sampling variances
dat <- escalc(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat.bcg)
 
### fit random-effects models
res <- rma(yi, vi, data=dat, slab=paste(author, year, sep=", "))
 
### cumulative meta-analysis (in the order of publication year)
tmp <- cumul(res, order=order(dat$year))
 
### cumulative forest plot
forest(tmp, xlim=c(-4,2), at=log(c(0.125, 0.25, 0.5, 1, 2)), 
       atransf=exp, digits=c(2,3), cex=0.75)
 
### switch to bold font
par(cex=0.75, font=2)
 
### add column headings to the plot
text(-4, 15, "Author(s) and Year",  pos=4)
text( 2, 15, "Risk Ratio [95% CI]", pos=2)

References

Chalmers, T. C., & Lau, J. (1993). Meta-analytic stimulus for changes in clinical trials. Statistical Methods in Medical Research, 2, 161–172.

Lau, J., Schmid, C. H., & Chalmers, T. C. (1995). Cumulative meta-analysis of clinical trials builds evidence for exemplary medical care. Journal of Clinical Epidemiology, 48, 45–57.

plots/cumulative_forest_plot.1492966621.txt.gz · Last modified: 2017/04/23 16:57 by 127.0.0.1