# The metafor Package

A Meta-Analysis Package for R

### Sidebar

plots:cumulative_forest_plot

## 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)

### 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, header="Author(s) and Year")

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.

### Page Tools
{"ft_lang_label":"__label__en","ft_lang_prob":0.6675547,"math_prob":0.9172672,"size":1392,"snap":"2020-45-2020-50","text_gpt3_token_len":380,"char_repetition_ratio":0.12608069,"word_repetition_ratio":0.0,"special_character_ratio":0.29094827,"punctuation_ratio":0.23050848,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9836324,"pos_list":[0,1,2,3,4,5,6],"im_url_duplicate_count":[null,null,null,7,null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-12-01T02:04:49Z\",\"WARC-Record-ID\":\"<urn:uuid:06e48558-a799-4528-80e5-ed6f0d99e43d>\",\"Content-Length\":\"19549\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:509b4764-9b7f-41b9-8963-334e7c0084c4>\",\"WARC-Concurrent-To\":\"<urn:uuid:bc222cac-ec75-4484-99bf-889a69d54a4e>\",\"WARC-IP-Address\":\"108.60.24.27\",\"WARC-Target-URI\":\"http://metafor-project.org/doku.php/plots:cumulative_forest_plot\",\"WARC-Payload-Digest\":\"sha1:6FVHBMU4GTXMZPX26JAV65KKFDDCLLXD\",\"WARC-Block-Digest\":\"sha1:QXJTNTCOLLAW5HOHHL5NNSSEUY233OBD\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-50/CC-MAIN-2020-50_segments_1606141542358.71_warc_CC-MAIN-20201201013119-20201201043119-00005.warc.gz\"}"}