【问题标题】:using the addpoly function in a forest plot - metafor package在森林图中使用 addpoly 函数 - metafor 包
【发布时间】:2016-11-12 06:26:24
【问题描述】:

我想用以下标签将多边形添加到森林图:

“我2 = 92.2%”

其中“2”是上标,“92.2%”是从 rma 对象(即res$I2)中调用的。

这是一个虚构的例子:

library(metafor)
data(dat.bcg)
res <- rma(ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat.bcg, measure="RR", 
           method="REML")
forest(res)
addpoly(res,mlab=*)

* 应该是什么?

以下不上标“2”:

paste("I2 = ",round(res$I2,1),"%"))

下面的根本不起作用。

bquote(I^2==.(round(res$I2,1))*"%")

【问题讨论】:

    标签: r plot statistics labels axes


    【解决方案1】:

    你必须把bquote()的结果变成一个表达式:

    addpoly(res, mlab=as.expression(bquote(I^2==.(round(res$I2,1))*"%")))
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-11-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-12-15
      • 2014-08-11
      • 1970-01-01
      相关资源
      最近更新 更多