【问题标题】:Meta-analysis: Forest plot of summary estimates using meta package元分析:使用元包的汇总估计的森林图
【发布时间】:2014-09-17 22:48:45
【问题描述】:

我发现有一种方法可以使用“metafor”包创建汇总估计的森林图,可以在此处找到:Meta-analysis: Forest plot of summary estimates using metafor package

meta 包也有解决方案吗?通过 30 多项研究,byvar 函数生成的森林图不适合窗口。

【问题讨论】:

  • 感谢“元”包的维护者 Guido Schwarzer,我找到了解决方案。一个好的解决方案是将绘图保存为 .pdf。您必须使用“宽度”和“高度”参数。

标签: r meta


【解决方案1】:

这里是一个例子:

### the data

d <- structure(list(study = structure(c(1L, 2L, 3L, 4L, 5L, 6L, 7L, 
7L, 8L, 8L, 8L, 10L, 9L, 11L, 11L, 12L, 13L, 14L, 14L, 15L, 16L, 
17L, 18L), .Label = c("Bort et al. 2012                ", "Boyl et al. 2004                ", 
"Cart et al. 2007                ", "Coryet al. 2009                 ", 
"Cosoff 1998                     ", "Dell'a 2011                     ", 
"Dilan 2003                      ", "Dilton et al. 1997              ", 
"Mac et al. 2001                 ", "Man et al. 2006                 ", 
"Okan 2011                       ", "Orol et al. 2006                ", 
"Pinto et al. 2003               ", "Simone et al. 2004              ", 
"Strahowski et al. 1992          ", "Tamara 2002                     ", 
"Viera et al. 2001               ", "Zucchi et al. 2006              "
), class = "factor"), xi = c(60, 40, 13, 107, 3, 32, 1, 16, 33, 
1, 20, 46, 27, 30, 22, 78, 35, 33, 5, 2, 4, 3, 4), ni = c(200, 
140, 56, 427, 20, 508, 25, 19, 53, 32, 44, 191, 288, 50, 46, 
918, 151, 360, 115, 41, 70, 129, 80), group = structure(c(3L, 
3L, 1L, 3L, 3L, 3L, 1L, 1L, 2L, 1L, 1L, 3L, 3L, 1L, 2L, 3L, 3L, 
1L, 2L, 1L, 1L, 4L, 4L), .Label = c("anxiety     ", "depression  ", 
"mixed       ", "remission   "), class = "factor")), .Names = c("study", 
"xi", "ni", "group"), row.names = c(NA, -23L), class = "data.frame", codepage = 1252L)

attach(d)

### the code

### load the library

library(meta)

library(metafor)

#### the model 
#### Freeman-Tukey Double arcsine transformation
#### Empirical Bayes estimator  and Hartung and Knapp adjustment

model <- metaprop(xi,ni,sm="PFT",hakn=TRUE, method.tau="EB")

########################
#
# subgroup analyses
#
########################


modelsub <- update(model, byvar=group)

summary(modelsub)

forest(modelsub,studlab=paste(study), print.byvar=FALSE)

#################################
#
# solution to a poor forest plot
#
#################################

### a good solution is to save the plot in .pdf 
### you have to play around with the 'width' and 'height' parameters 
### I used  width=12,height=13 (as higher the values, as more space you will get)

pdf(file="good forest plot.pdf", width=12,height=13)

forest(modelsub,studlab=paste(study), print.byvar=FALSE)

dev.off()

【讨论】:

  • sessionInfo() R 版本 3.0.2 (2013-09-25) 平台:x86_64-w64-mingw32/x64(64 位)语言环境:[1] LC_COLLATE=Italian_Italy.1252 LC_CTYPE=Italian_Italy .1252 [3] LC_MONETARY=Italian_Italy.1252 LC_NUMERIC=C [5] LC_TIME=Italian_Italy.1252 附加基础包:[1] 网格统计图形 grDevices 实用程序数据集方法 [8] 基础其他附加包:[1] metafor_1.9- 3 Matrix_1.1-0 Formula_1.1-1 meta_3.7-1 psych_1.4.5 [6] foreign_0.8-57 通过命名空间加载(未附加):[1] lattice_0.20-24 tools_3.0.2跨度>
猜你喜欢
  • 2014-08-11
  • 1970-01-01
  • 1970-01-01
  • 2018-02-05
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-03-20
  • 1970-01-01
相关资源
最近更新 更多