statistics - Forest plot in R with both effect and no effect lines -


i have made forest plot in r using forestplot package. code follows:

#forestplot    labeltext2 <- c("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "summary effect")  effect2 <- c(0.12, 0.61, 0.11, 0.25, 0.24, 0.63, 0.33, 0.41, 0.38, 0.52, 0.23, 0.47,          0.32, 0.36, 0.03, 0.15, 0.25, 0.67, 0.003, 0.32)   lower_2 <- c(0.08, 0.51, .03, 0.11, 0.06, 0.62, 0.11, 0.29, 0.18,           0.4, 0.19, 0.39, 0.24, 0.39, -0.13, 0.01, 0.09, 0.43,          -0.08, 0.19)  higher_2 <- c(0.16, 0.71, .19, 0.39, 0.42, 0.64, 0.55, 0.53, 0.58,            0.64, 0.27, 0.55, 0.4, 0.4, 0.19, 0.29, 0.41, 0.91,           0.08, 0.44)  forestplot(labeltext2, effect2, lower_2, higher_2, 0 = .32,        cex = 2,         lineheight = "auto",        xlab = "effect size",        xticks = c(-.5, 0, .5, 1, 1.5),        title = "forestplot",        new_page = true) 

which allows me image: forestplot

this image has effect line coming @ .32, summary effect, using 0 argument. add additional thick black line @ 0 show "no-effect" line. know how this? open using package/function.

thank you!

i can't figure out how forestplot uses grid graphics, here's manual solution:

forestplot(labeltext2, effect2, lower_2, higher_2, 0 = .32,            cex = 2,             lineheight = "auto",            xlab = "effect size",            xticks = c(-.5, 0, .5, 1, 1.5),            title = "forestplot",            new_page = true)  # add line manually x = .397 y0 = .12 y1 = .875 grid.lines(c(x, x), c(y0, y1), default.units = "npc",            gp = gpar(lwd = 2)) 

Comments