1

我有兴趣为森林图制作两个子组。其中一个子组将是“完整的”,而另一个将是“不完整的”。我希望得到类似于 metafor 给出的示例之一的内容:

在 imgur.com 上查看帖子

目前,这是我用我的代码制作的森林图:

在 imgur.com 上查看帖子

Study <- c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)

Author <- c('Study 1', 'Study 2', 'Study 3', 'Study 4','Study 5', 'Study 6', 'Study 7', 'Study 8', 'Study 9',
        'Study 10', 'Study 11', 'Study 12', 'Study 13', 'Study 14', 'Study 15')

Year <- c(2014, 2008, 2013, 2013, 2011, 2013, 2013, 2012, 2013, 2012, 2013, 2014, 2014, 2011, 2014)

EffectSize <- c(0.520, 0.110, 0.260, 0.204, 0.443, 0.156, 0.160, 0.280, 0.051, 0.082, 0.268,-0.360, 0.333, 0.519, 0.300)

SampleSize<- c(37, 255, 143, 143, 92, 563, 94, 117, 147, 1352, 368, 28, 52, 21, 48)

Outcome <- c('Incomplete', 'Incomplete', 
         'Completed Some', 'Completed Some', 
         'Completed Some', 'Completed Some', 
         'Completed Some',  'Completed Most', 
         'Completed Most', 'Completed Most', 'Completed Most', 'Complete',
         'Anxiety & Depression', 'Complete', 'Complete')

Allocation <- c('Other', 'Other', 'Other', 'Other', 'Other', 'Other', 'Other', 'Other', 'Other', 'Other', 'Other', 'Complete',
            'Other', 'Complete', 'Complete')


meta.data <-data.frame(Study, Author, Year, EffectSize, SampleSize, Outcome, Allocation)


Meta.poster <- escalc(measure = "COR", ri = EffectSize, ni = SampleSize, data = meta.data)

meta.random.model <- rma(yi = yi, vi = vi, data = Meta.poster, slab = Author, level = 95)



fsn(yi, vi, data = Meta.poster)

forest(meta.random.model) #Basic forest plot

forest(meta.random.model, slab = paste(Meta.poster$Author, Meta.poster$Year, sep = ", "))

op <- par(cex = 0.90, font = 2)
text(-1.45, 16.5, "First Author and Year", pos = 2)
text(2.65, 16.5, "Effect Size [95% CI]", pos = 2)
par(op)

漏斗(meta.random.model

4

1 回答 1

1

好吧,正如您显然已经发现的那样,网站基本上提供了您要查找的代码。

forest(meta.random.model, 
       order=order(meta.data$Outcome), 
       rows=c(1:2, 4:12, 14:16, 18), 
       ylim=c(-1, 22)
)
text(-2,
     c(19, 17, 13, 3), 
     pos=4, 
     c("Anxiety & Depression", "Complete", "Completed Most", "Incomplete")
)

理解这一点的关键是,森林从下面计算行数。

利用

text(x=-2, y=-10:100, labels=c(-10:100))
text(x=c(-10:10), y=0, labels(c(-10:10)))

或类似的东西,在你的情节中为所有需要指定的东西找到坐标。

于 2015-10-27T20:18:28.543 回答