1

我想从森林图中省略一些具有巨大标准误差的研究,因为它们难以解释。但我不想改变估计。下面是一个玩具示例:

### load BCG vaccine data
data(dat.bcg)

### meta-analysis of the log relative risks using a random-effects model
res <- rma(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat.bcg,
           slab=paste(author, year, sep=", "))

### Let's say I want to omit the first study, the rows argument doesn't work as expected
forest(res, rows = c(2:13))

Error in forest.rma(res, rows = c(2:13)) : 
Number of outcomes does not correspond to the length of the 'rows' argument.

有任何想法吗?

4

1 回答 1

1

您可以使用 构建森林图forest(),将估计值和相应的抽样方差传递给函数。使用该subset参数,您可以省略不想包含在图中的研究。然后将基于模型的汇总估计(使用完整数据集)添加到带有addpoly(). 使用玩具示例:

### load BCG vaccine data
data(dat.bcg)

### load BCG vaccine data
data(dat.bcg)

### calculate log relative risks and corresponding sampling variances
dat <- escalc(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg, 
              data=dat.bcg, slab=paste(author, year, sep=", "))

### meta-analysis of the log relative risks using a random-effects model
res <- rma(yi, vi, data=dat)
res

### forest plot of all studies
forest(dat$yi, dat$vi, ylim=c(-1.5,16))
addpoly(res, row=-1)
abline(h=0)

### forest plot omitting 1st study
forest(dat$yi, dat$vi, ylim=c(-1.5,15), subset=-1)
addpoly(res, row=-1)
abline(h=0)
于 2016-01-06T20:47:31.723 回答