i've made foresplot in r using metafor package following code:
res <- metafor::rma(cohens_d, variance, data = my_data) par(mar=c(3.4,0,0,0)) par(cex=2.5, font=4) metafor::forest.rma(res, alim=c(-3.75, 3.75), xlab = "cohen's d 95% ci", slab = my_data$paper)
which gives me image:
i'd flip x axis, meaning have negative on right. ideas on how this?
thank you!
okay, ridiculous hack, works. basically, have draw plot twice, once add points (with reversed signs) , once add annotations (without reversed signs).
library(metafor) dat <- get(data(dat.bcg)) dat <- escalc(measure="rr", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat.bcg) res <- rma(yi, vi, data=dat) ### default plot forest(res, xlim=c(-8,8)) ### trick reverse x-axis forest(res, xaxt="n", transf=function(x) -1*x, annotate=false, xlim=c(-8,8), xlab="log relative risk") axis(side=1, at=seq(-3, 3, 1), labels=seq(3,-3,-1)) par(new=true) forest(res, xaxt="n", xlim=c(-8,8), col="white", border="white", pch=na, lty="blank", efac=na, xlab="", slab=na, mlab=na) par(new=false)
Comments
Post a Comment