在 R 中使用 posthoctgh 时获取未格式化的 p 值

Obtaining unformatted p values when using posthoctgh in R

我目前正在分析一个数据集,其中的组是异方差的。因此,我使用 Welch ANOVA 来测试均值之间的显着差异。这些结果很重要,因此我希望执行 post hoc Games-Howell 测试以确定哪些组彼此不同。我正在使用 posthocTGH 函数,它是 userfriendlyscience 包的一部分。这根据 APA 标准格式化 p 值,但我想知道未格式化的值是什么。我试过使用 formatPvalue = FALSE 参数来修改它,但这不会改变显示的 p 值。

当前代码:

posthoc<-posthocTGH(y=dataset$climb.distance, 
           x=dataset$genotype, 
           method=c("games-howell"),
           formatPvalue = FALSE)

如果我没有正确理解你的问题,你可以获得如下未格式化的p值:

phoc <- posthocTGH(y=ChickWeight$weight, x=ChickWeight$Diet, method="games-howell")
(outmtx <- phoc$output$games.howell)

         diff       ci.lo    ci.hi         t       df            p   p.adjusted
2-1 19.971212   0.3575276 39.58490 2.6378339 201.3839 4.420348e-02 0.1768139320
3-1 40.304545  17.5439718 63.06512 4.5930381 175.9190 4.883308e-05 0.0002929985
4-1 32.617257  13.4519674 51.78255 4.4086175 203.1602 9.873989e-05 0.0004936994
3-2 20.333333  -6.2029177 46.86958 1.9829842 229.9425 1.974058e-01 0.5922172720
4-2 12.646045 -10.9092650 36.20136 1.3891079 235.8785 5.074188e-01 1.0000000000
4-3 -7.687288 -33.8987923 18.52422 0.7590752 226.1567 8.726938e-01 1.0000000000

可以使用以下方法提取 p 值向量:

outmtx$p.adjusted

[1] 0.1768139320 0.0002929985 0.0004936994 0.5922172720 1.0000000000 1.0000000000

希望对您有所帮助