【问题标题】:R - Metafor package–calculate and display odds ratio instead of log odds ratioR - Metafor 包——计算并显示优势比而不是对数优势比
【发布时间】:2019-10-27 01:43:28
【问题描述】:

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

感谢大家的帮助!

【问题讨论】:

    标签: r metafor


    【解决方案1】:

    escalc 函数中所述:

    “测量”参数的选项是:

           • ‘"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) 来获得奇数比和几个类似的微积分,以使所有结果都以纯奇数比表示。可能还有另一种我不知道的方式。

    【讨论】:

      【解决方案2】:

      在实现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")"
      

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

      【讨论】:

        猜你喜欢
        • 2020-07-16
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2018-06-16
        • 1970-01-01
        • 2021-05-23
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多