Skip to content
Prev 4669 / 5636 Next

[R-meta] Question on metafor forest plot

Dear Gabriel,

The point sizes can also be set manually via the 'psize' argument. For example:

dat <- dat.bcg
dat <- escalc(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg, 
              data=dat, slab=paste0(author, ", ", year))
res <- rma(yi, vi, data=dat)

forest(res, header=TRUE, top=2)

forest(res, header=TRUE, top=2, cex=1.5, psize=weights(res)/10)

You can play around with the factor in weights(res)/10 until you like the size. Or just use psize=1 (or some other constant) to not draw points in different sizes.

The other thing that changes is the height of the lines at the end of the CI bounds and the size of the summary polygon. These can be controlled via the 'efac' argument. For example:

forest(res, header=TRUE, top=2, cex=1.5, psize=weights(res)/10, efac=0.7)

Again, play around with efac until you like how it looks. You can also specify two values for the lines at the end of the CI bounds and the summary polygon separately. For example:

forest(res, header=TRUE, top=2, cex=1.5, psize=weights(res)/10, efac=c(0,0.7))

Best,
Wolfgang