如何使用emmeans包执行指定对比的对比?
我对两个时间点的差异感兴趣。我在最后使用了对(LF)语句,我得到了正确的估计,但是相同的p值(我想要假设的单独测试 - 即我期望不同的p值取决于估计的大小)。 / p>
> mod.rg <- ref_grid(mod, at = list(time = c(0, 1, 7, 13, 26)))
> (mod_em <- emmeans(mod.rg, c("TX_GROUP","time")))
TX_GROUP time emmean SE df asymp.LCL asymp.UCL
0 0 57.8 2.77 Inf 52.4 63.2
1 0 64.0 1.75 Inf 60.6 67.4
0 1 58.0 2.81 Inf 52.5 63.5
1 1 64.3 1.76 Inf 60.9 67.8
0 7 59.0 3.09 Inf 52.9 65.1
1 7 66.3 1.92 Inf 62.5 70.0
0 13 60.0 3.49 Inf 53.2 66.9
1 13 68.2 2.18 Inf 64.0 72.5
0 26 62.2 4.62 Inf 53.2 71.3
1 26 72.5 2.93 Inf 66.7 78.2
Covariance estimate used: vbeta
Confidence level used: 0.95
> # Test contrasts
> (LF <- contrast(mod_em, list(Baseline = c(-1, 1, 0, 0, 0, 0, 0, 0, 0, 0), `1 month` = c(0, 0, -1, 1, 0, 0, 0, 0, 0, 0) , `7 months` = c(0, 0, 0, 0, -1, 1, 0, 0, 0, 0), `13 months` = c(0, 0, 0, 0, 0, 0, -1, 1, 0, 0), `24 months` = c(0, 0, 0, 0, 0, 0, 0, 0, -1, 1))))
contrast estimate SE df z.ratio p.value
Baseline 6.17 3.32 Inf 1.86 0.0629
1 month 6.33 3.36 Inf 1.89 0.0592
7 months 7.27 3.68 Inf 1.98 0.0482
13 months 8.21 4.16 Inf 1.98 0.0483
24 months 10.25 5.51 Inf 1.86 0.0629
> # Contrasts of contrasts
> pairs(LF)
contrast estimate SE df z.ratio p.value
Baseline - 1 month -0.157 0.142 Inf -1.1 0.8046
Baseline - 7 months -1.098 0.994 Inf -1.1 0.8046
Baseline - 13 months -2.038 1.847 Inf -1.1 0.8046
Baseline - 24 months -4.077 3.693 Inf -1.1 0.8046
1 month - 7 months -0.941 0.852 Inf -1.1 0.8046
1 month - 13 months -1.882 1.704 Inf -1.1 0.8046
1 month - 24 months -3.920 3.551 Inf -1.1 0.8046
7 months - 13 months -0.941 0.852 Inf -1.1 0.8046
7 months - 24 months -2.979 2.699 Inf -1.1 0.8046
13 months - 24 months -2.038 1.847 Inf -1.1 0.8046
P value adjustment: tukey method for comparing a family of 5 estimates