metafor包中的Mantel-Haenszel方法(随机效应)
可以在 metafor 包中对随机效应元分析应用Mantel-Haenszel方法吗?
据我所知,命令 rma.mh 将Mantel-Haenszel应用于固定效应模型。
若不可行,R里还有其他解决办法吗?那 meta 包呢?
解决方案
“Mantel-Haenszel随机效应”方法在Cochrane综述中有时会被使用,其实只是标准的逆方差法;但在用DerSimonian-Laird推断异质性程度(即tau^2)时,该方法使用来自Mantel-Haenszel合并估计的值来计算Q 统计量(与使用来自标准等效应模型的合并估计不同)。差异通常可以忽略不计。下面是一个小例子:
library(metafor)
dat <- read.table(header=TRUE, text = "
study year treat.events treat.total placebo.events placebo.total
'Brumfitt' 1957 21 42 26 40
'Chapple' 1956 40 135 37 65
'De Meyere' 1992 18 82 59 91
")
dat
现在我们计算对数风险比:
dat <- escalc(measure="RR", ai=treat.events, n1i=treat.total,
ci=placebo.events, n2i=placebo.total, data=dat)
dat
现在我们用tau^2的 DL估计量来拟合一个标准的随机效应模型:
res <- rma(yi, vi, data=dat, method="DL")
res
predict(res, transf=exp, digits=2)
这将得到以下结果:
Random-Effects Model (k = 3; tau^2 estimator: DL)
tau^2 (estimated amount of total heterogeneity): 0.1095 (SE = 0.1482)
tau (square root of estimated tau^2 value): 0.3309
I^2 (total heterogeneity / total variability): 74.38%
H^2 (total variability / sampling variability): 3.90
Test for Heterogeneity:
Q(df = 2) = 7.8053, p-val = 0.0202
Model Results:
estimate se zval pval ci.lb ci.ub
-0.6552 0.2219 -2.9534 0.0031 -1.0901 -0.2204 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
pred ci.lb ci.ub pi.lb pi.ub
0.52 0.34 0.80 0.24 1.13
现在我们使用Mantel-Haenszel方法来获得从MH方法的合并估计所计算的Q 统计量:
res <- rma.mh(measure="RR", ai=treat.events, n1i=treat.total,
ci=placebo.events, n2i=placebo.total, data=dat)
res
现在我手动使用DL估计来计算tau^2的估计量,但在此使用来自MH方法的Q 统计量来做:
wi <- 1 / dat$vi
tau2 <- (res$QE - (res$k-1)) / (sum(wi) - sum(wi^2) / sum(wi))
res <- rma(yi, vi, data=dat, tau2=tau2)
res
predict(res, transf=exp, digits=2)
这将得到以下结果:
Random-Effects Model (k = 3; user-specified tau^2 value)
tau^2 (specified amount of total heterogeneity): 0.1180 (SE = 0.1563)
tau (square root of specified tau^2 value): 0.3435
I^2 (total heterogeneity / total variability): 75.78%
H^2 (total variability / sampling variability): 4.13
Test for Heterogeneity:
Q(df = 2) = 7.8053, p-val = 0.0202
Model Results:
estimate se zval pval ci.lb ci.ub
-0.6558 0.2282 -2.8740 0.0041 -1.1030 -0.2086 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
pred ci.lb ci.ub pi.lb pi.ub
0.52 0.33 0.81 0.23 1.16
结果本质上相同。
这在 metafor 中并未直接实现,但可以按上述方式进行此分析。
站内所有文章版权归属LeftHeroAI导航站,无授权禁止任何主体转载、抄袭、复制内容,亦不得私自架设镜像站点。一经侵权,本站将通过法律途径追责。