我对一个有很多关联的数据运行pairwise.wilcox.test(),得到以下警告:
Warning in wilcox.test.default(xi, xj, paired = paired, ...) :
cannot compute exact p-value with ties我想知道wilcox.test()是如何处理这些联系的?
(默认情况下)使用什么方法对观察结果进行排序?
"P值调整方法: holm“是什么意思?
发布于 2022-06-13 16:09:21
当有联系时,wilcox.test使用正态近似。您可以看到代码这里:下面是一个稍微简化的版本。
## example values
x <- 1:5
y <- 2:6
## assumes mu=0
r <- c(x, y)
## slightly simplified (assumes `digits.rank` is equal to its default `Inf` value)
r <- rank(r)
NTIES <- table(r)
n.x <- length(x)
n.y <- length(y)
STATISTIC <- c("W" = sum(r[seq_along(x)]) - n.x * (n.x + 1) / 2)
z <- STATISTIC - n.x * n.y / 2
SIGMA <- sqrt((n.x * n.y / 12) *
((n.x + n.y + 1)
- sum(NTIES^3 - NTIES) ## this will be zero in the absence of ties
/ ((n.x + n.y) * (n.x + n.y - 1))))
## stuff about continuity correction omitted here
z <- z/SIGMA ## z-score, used to compute p-value
2*pnorm(z) ## 2-tailed p-value (skipped testing whether in lower or upper tail)这给出了与wilcox.test(x, y, correct = FALSE)相同的p值.
至于p值调整(" Holm "),这将指向?p.adjust的帮助页面,该页面说它正在使用Holm (1979)的方法。您可以了解更多关于这里方法的信息(例如)。
Holm,S. (1979年)。一个简单的顺序拒绝多个测试过程。斯堪的纳维亚统计杂志,6,65-70。https://www.jstor.org/stable/4615733。
https://stackoverflow.com/questions/72605531
复制相似问题