How does R compute the p-value in the Wilcoxon Rank Sum Test? If I have the test statistics, can I get the p-value using the function pwilcox? Thanks -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Wilcoxon Rank Sum Test
2 messages · Ngayee.Law@celeradiagnostics.com, Peter Dalgaard
Ngayee.Law at celeradiagnostics.com writes:
How does R compute the p-value in the Wilcoxon Rank Sum Test? If I have the test statistics, can I get the p-value using the function pwilcox? Thanks
Yes, but only if there are no ties in the data.
You can just print wilcox.test.default and see the following code:
if (exact && !TIES) {
PVAL <- switch(alternative, two.sided = {
p <- if (STATISTIC > (n.x * n.y/2))
pwilcox(STATISTIC - 1, n.x, n.y, lower = FALSE)
else pwilcox(STATISTIC, n.x, n.y)
min(2 * p, 1)
}, greater = {
pwilcox(STATISTIC - 1, n.x, n.y, lower = FALSE)
}, less = pwilcox(STATISTIC, n.x, n.y))
....
}
O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._