我在R中使用metaprop命令对比例进行元分析。下面是一些示例代码。
library(meta)
m <- metaprop(4:1, c(10, 20, 30, 40))
forest(m)
我有几个问题。
修改
好的,我已经弄清楚如何做几乎所有事情。我唯一需要帮助的是,我有另一个标签向量,我想添加到图的左侧。似乎leftlabs或leftcols命令应该这样做但我不能让它工作。我还想在左侧绘制另一列,标题为&#34;详细信息&#34;对于这四项研究中的每项研究,对它们都有一点判断。
forest(m, xlim = c(0,100), pscale = 100, weight = "random", leftcols = c("studlab", "event", "n", "effect", "ci", "w.random"), rightcols = F, leftlabs = c("Study", "Number", "Total", "Prevalence (%)", "95% CI", "Weight"), xlab = "Prevalence (%)", addspace = TRUE, digits = 1, squaresize = 0.5, text.I2 = "I2", text.tau2 = "tau2")
答案 0 :(得分:0)
# https://rdrr.io/cran/meta/man/forest.html
# See the example in the link above, specifically
data(Olkin95)
meta1 <- metabin(event.e, n.e, event.c, n.c,
data=Olkin95, subset=c(41,47,51,59),
sm="RR", method="I",
studlab=paste(author, year))
#
# Specify column labels only for newly created variables
# 'year' and 'author' (which are part of dataset Olkin95)
#
forest(meta1,
leftcols=c("studlab", "event.e", "n.e", "event.c", "n.c",
"author", "year"),
leftlabs=c("Author", "Year of Publ"))