Skip to content
Prev 319499 / 398506 Next

Create patterns within a plot?

Same idea, but just using base graphics and using an x-axis with log units:

library(metafor)

data(dat.bcg)

res <- rma(measure="OR", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat.bcg, slab=paste(dat.bcg$author, dat.bcg$year, sep=", "))

forest(res, cex=.9, at=log(c(.05, .25, 1, 4)), xlim=c(-10,7), atransf=exp)
rect(log(0.5), 0.1, log(1.5), 13.9, col="gray90", border=NA)
par(new=TRUE)
forest(res, cex=.9, at=log(c(.05, .25, 1, 4)), xlim=c(-10,7), atransf=exp)

Best,
Wolfgang