我有兴趣为森林情节制作两个小组。其中一个小组将是"完成"而另一个则是'#34; Incomplete。"我希望得到一些与metafor给出的例子类似的东西:
目前,这是我用我的代码制作的森林情节:
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
答案 0 :(得分:1)
好吧,正如您已经发现的那样,this网站基本上会提供您想要的代码。
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)))
或类似的东西,在你的情节中找到需要指定的所有类型的坐标。