もう少し手作業が必要ですが、最初にforest()
関数を使用してフォレスト プロットを作成し (すべてのスタディを表示し、下部に要約推定値用のスペースを残します)、次にモデルを適合させます (たとえば、rma()
関数を使用して) すべてを除外します。分析に含めたくないスタディを選択し、addpoly()
関数を使用して要約推定値を追加します。
次に例を示します。
library(metafor)
### load BCG vaccine data
data(dat.bcg)
### calculate log relative risks and corresponding sampling variances
dat <- escalc(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat.bcg, slab=paste(dat$author, dat$year, sep=","))
dat
### forest plot of all studies
forest(dat$yi, dat$vi, xlim=c(-9.5, 7.5), ylim=c(-1.5,16), atransf=exp, at=log(c(.05, .25, 1, 4, 20)))
text(-9.5, 15, "Author(s) and Year", pos=4)
text( 7.5, 15, "Observed RR [95% CI]", pos=2)
### random-effects model (without Aronson, 1948)
res <- rma(yi, vi, data=dat, subset=author!="Aronson")
res
### add summary estimate to the bottom
addpoly(res, atransf=exp, row=-1, mlab="RE Model (w/out Aronson, 1948)")
### horizontal separation line
abline(h=0)