[R-meta] forest plot using metafor: how to add CIs as line segments

Sophia Kyriakou sophia.kyriakou17 at gmail.com
Wed Aug 16 22:50:35 CEST 2017


At the moment I have a forest plot obtained using the following code chunk.

data <- data.frame(y = c(-1.90, 1.00, -3.50, -5.90, -4.00),
sigma2 = c(0.34, 0.84, 1.37, 1.37, 0.28),
author = c("Study 1","Study 2","Study 3","Study 4","Study 5"))
estim <- data.frame(pred = c(-2.80,-2.80),LRlow = c(-4.78,-5.26),LRup =

res <- rma(y, sigma2, data=data, method = "ML")
forest.rma(res, xlim=c(-23, 15), at=seq(-10,4,2), slab=data$author,
ylim=c(-3, 8), xlab="Change in DBP", mlab="")
text(par("usr")[2], 7, pos=2, "DBP Change, [95% CI]", font=2)
text(par("usr")[1], -1, pos=4, "ML")
addpoly(estim$pred, ci.lb=estim$LRlow, ci.ub=estim$LRup, rows=-2,
mlab=c("DL", "DR"))

I would like to change the diamonds that  represent confidence intervals
into horizontal line segments, indicating the lower and upper limits of the
confidence interval. I am not interested in showing the estimated overall
effect of the model.
Is that possible?

Thanks in advance.

	[[alternative HTML version deleted]]

More information about the R-sig-meta-analysis mailing list