从 R 中的输出中提取元分析估计和 CI [英] Extracting meta analysis estimate and CI from output in R
问题描述
library(meta)
m1 <- metaprop(4:1, c(10, 20, 30, 40))
m2 <- update(m1, sm="PAS")
m3 <- update(m1, sm="PRAW")
m4 <- update(m1, sm="PLN")
m5 <- update(m1, sm="PFT")
#
forest(m5)
我这里有一个简单的例子,我想提取效果的随机估计值及其对应的 95% CI(即 0.11[ 0.01; 0.26] 如图所示).
I have a simple example here, and I want to extract the random estimate of the effect and its corresponding 95% CI (i.e. 0.11[ 0.01; 0.26] as shown in the picture).
我使用 names(m5)
来查看值列表.我尝试了 m5$lower.random
以期获得随机效应模型的 CI 下限,但返回的值是 0.1837517 而不是 0.01,这是森林图中显示的值.
I used names(m5)
to see a list of values. And I've tried m5$lower.random
in hopes of getting the lower CI bound for the random effects model, but the returned value is 0.1837517 instead of 0.01, which is what's presented in the forest plot.
推荐答案
要计算随机效应模型估计的比例(具有 95% 置信区间),m5$TE.random
, m5$lower.random
和 m5$upper.random
值需要根据 metaprop
中指定的 sm
选项进行反向转换>.
让我们考虑第一种情况,其中选择 logit 变换来计算总体比例:
To calculate the proportion estimated by the random effects models (with 95% confidence intervals), the m5$TE.random
, m5$lower.random
and m5$upper.random
values need to be backtransformed according to the sm
option specified in metaprop
.
Let consider a first case where the logit transformation was chosen to calculate an overall proportion:
library(meta)
m1 <- metaprop(4:1, c(10, 20, 30, 40), sm="PLOGIT")
summary(m1)
################
Number of studies combined: k = 4
proportion 95%-CI z p-value
Fixed effect model 0.1439 [0.0769; 0.2533] -- --
Random effects model 0.1214 [0.0373; 0.3306] -- --
Quantifying heterogeneity:
tau^2 = 1.1288; H = 1.77 [1.04; 3.01]; I^2 = 68.0% [7.1%; 89.0%]
Test of heterogeneity:
Q d.f. p-value
9.38 3 0.0247
Details on meta-analytical method:
- Inverse variance method
- DerSimonian-Laird estimator for tau^2
- Logit transformation
- Clopper-Pearson confidence interval for individual studies
(random.est1 <- c(m1$TE.random,m1$lower.random,m1$upper.random))
meta:::backtransf(random.est1, sm="PLOGIT")
meta:::logit2p(random.est1)
################
我们从m1
中提取随机效应模型的转换值:
We extract from m1
the trasformed values of the random effect model:
(random.est1 <- c(m1$TE.random,m1$lower.random,m1$upper.random))
###############
[1] -1.9788316 -3.2521123 -0.7055509
然后我们使用 meta
meta:::backtransf(random.est1, sm="PLOGIT")
#######
[1] 0.12144344 0.03725106 0.33058266
或直接进行 logit 反向转换 logit2p
:
or directly the logit backtransformation logit2p
:
meta:::logit2p(random.est1)
#######
[1] 0.12144344 0.03725106 0.33058266
相当于:
plogis(random.est1)
#######
[1] 0.12144344 0.03725106 0.33058266
现在我们考虑使用 Freeman-Tukey 双反正弦变换的第二个示例:
Now we consider a second example using the Freeman-Tukey Double arcsine transformation:
m2 <- metaprop(4:1, c(10, 20, 30, 40), sm="PFT")
summary(m2)
###################
Number of studies combined: k = 4
proportion 95%-CI z p-value
Fixed effect model 0.0775 [0.0272; 0.1449] -- --
Random effects model 0.1093 [0.0138; 0.2589] -- --
Quantifying heterogeneity:
tau^2 = 0.0229; H = 1.78 [1.05; 3.04]; I^2 = 68.6% [9.1%; 89.2%]
Test of heterogeneity:
Q d.f. p-value
9.56 3 0.0227
Details on meta-analytical method:
- Inverse variance method
- DerSimonian-Laird estimator for tau^2
- Freeman-Tukey double arcsine transformation
- Clopper-Pearson confidence interval for individual studies
###################
使用我们得到的反向转换
Using the backtrasformation we get
random.est2 <- c(m2$TE.random,m2$lower.random,m2$upper.random)
unlist(lapply(random.est2, meta:::backtransf, sm="PFT", n=1/mean(1/m2$n)))
########
[1] 0.10932841 0.01376599 0.25889792
unlist(lapply(random.est2, meta:::asin2p, n=1/mean(1/m2$n)))
##########
[1] 0.10932841 0.01376599 0.25889792
这篇关于从 R 中的输出中提取元分析估计和 CI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!