我本质上是在寻找使用 metafor 包生成我的森林图。它目前工作得非常好,除了它产生对数优势比,而我想要纯优势比本身。在 metafor 代码中是否有一种简单的方法可以做到这一点?
#Metafor library
library(metafor)
#ReadXL library to import excel sheet
library(readxl)
#Name the data sheet from the excel file
abcd<- read_excel("analysis.xlsx")
#View the data sheet with view(abcd)
dpi=600 #pixels per square inch
tiff("metaor.tif", width=6*dpi, height=5*dpi, res=dpi)
#This below measures with risk ratios. If you want to measure odds ratios, use argument measure=OR
returnop <- escalc(measure="OR", ai=op_return_OR, bi=op_no_return_OR, ci=ip_return_OR, di=ip_no_return_OR, data=ACDF)
#Generate a Random Effects Model
REmodel<-rma(yi=yi, vi=vi, data=returnop, slab=paste(Author, Year, sep=", "), method="REML")
#Generate a forest plot of the data
forest(REmodel, xlim=c(-17, 6),
ylim=c(-1, 10),
ilab=cbind(abcd$op_return_OR, abcd$op_no_return_OR, abcd$ip_return_OR,
abcd$ip_no_return_OR),
ilab.xpos=c(-10,-8.4,-6.6,-4.9), cex=.75,
psize=1)
### add column headings to the plot
text(c(-10,-8.4,-6.6,-4.9), 8.5, c("Return+", "Return-", "Return+", "Return-"),
cex = 0.65)
text(c(-9.25,-5.75), 9.5, c("Outpatient", "Inpatient"))
text(-17, 8.5, "Study", pos=4)
text(6, 8.5, "Log Odds Ratio [95% CI]", pos=2)
dev.off()
感谢大家的帮助!