我正在metafor中进行元分析。将森林图从对数比例转换回正常比例后,我希望添加原始的置信区间(在以下数据中以ci.lb和ci.ub指定)。这是因为通过metafor从对数刻度返回的置信区间与原始区间不同,并且我希望我的森林图显示原始的置信区间(由我的Cox比例风险分析输出)
我使用的代码:
library(metafor)
library(tidyverse)
#create data [this is just an example- I have real data]
dat <- tibble(study = c(1, 2, 3, 4, 5, 6),
yi = runif(6, 0.001, 0.5),
sei = runif(6, 0.2, 0.4),
ni = runif(6, 70, 400),
outcome = "DFS",
author = "author",
year = c("2001","2002", "2003","2004", "2005", "2006"),
ci.lb = runif(6, 0.6, 1.5),
ci.ub = runif(6, 1.3, 4))
# random-effects model analysis for outcome DFS
res <- rma(yi, sei, ni, data=dat)
res
predict(res, transf=exp, digits=2)
#forest plot
par(mar=c(4,4,1,2))
res <- rma(yi, sei=sei, data=dat, slab=paste(author, year, sep=", "))
tmp <- cumul(res, order=order(dat$year))
forest(tmp, xlim=c(-4,2), at=log(c(0.125, 0.25, 0.5, 1, 2)),
atransf=exp, digits=c(2,3), cex=0.75, annotate=FALSE)
par(cex=0.75, font=2)
text(-4, 15, "Author(s) and Year", pos=4)
text( 2, 15, "Risk Ratio [95% CI]", pos=2)
forest(res, atransf= exp, showweights = T)
有人知道我该怎么做吗?已经为此挣扎了一段时间。 非常感谢您提供的任何见解:)谢谢