1

我本质上是在寻找使用 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()

感谢大家的帮助!

4

2 回答 2

0

escalc函数中所述:

'measure' 参数的选项是:

       • ‘"RR"’ for the _log risk ratio_.

       • ‘"OR"’ for the _log odds ratio_.

       • ‘"RD"’ for the _risk difference_.

       • ‘"AS"’ for the _arcsine square root transformed risk
         difference_ (Rücker et al., 2009).

       • ‘"PETO"’ for the _log odds ratio_ estimated with Peto's
         method (Yusuf et al., 1985).


     Note that the log is taken of the risk ratio and the odds
     ratio, which makes these outcome measures symmetric around 0
     and yields corresponding sampling distributions that are
     closer to normality.

出于这个原因,我想您的问题的答案是否定的,因为没有任何measure价值可以为您提供纯优势比和使用纯优势比 (OR) 的所有分析/数据。如果您想要纯 OR 我的猜测,您必须使用exp(),例如exp(returnop$yi)获得奇数比和一些类似的微积分,以使所有结果都以纯奇数比表示。可能还有另一种我不知道的方式。

于 2018-03-10T22:52:38.033 回答
0

实现forest()功能时,添加"atransf = exp"参数。那应该这样做。

"forest(REmodel, xlim=c(-17, 6), ylim=c(-1, 10), 
ilab=cbind(ACDF$op_return_OR, ACDF$op_no_return_OR, ACDF$ip_return_OR, 
ACDF$ip_no_return_OR), ilab.xpos=c(-10,-8.4,-6.6,-4.9), cex=.75, 
psize=1, atransf="exp")"

让我知道它是否有效,如果您有任何其他问题!

于 2018-05-04T20:36:40.647 回答