[R] wilcox.test - difference between p-values of R and online calculators

W Bradley Knox bradknox at mit.edu
Wed Sep 3 02:54:12 CEST 2014


Hi.

I'm taking the long-overdue step of moving from using online calculators to
compute results for Mann-Whitney U tests to a more streamlined system
involving R.

However, I'm finding that R computes a different result than the 3 online
calculators that I've used before (all of which approximately agree). These
calculators are here:

http://elegans.som.vcu.edu/~leon/stats/utest.cgi
http://vassarstats.net/utest.html
http://www.socscistatistics.com/tests/mannwhitney/

An example calculation is

*wilcox.test(c(359,359,359,359,359,359,335,359,359,359,359,359,359,359,359,359,359,359,359,359,359,303,359,359,359),c(332,85,359,359,359,220,231,300,359,237,359,183,286,355,250,105,359,359,298,359,359,359,28.6,359,359,128))*

which prints









*Wilcoxon rank sum test with continuity correction  data: c(359, 359, 359,
359, 359, 359, 335, 359, 359, 359, 359, 359, and c(332, 85, 359, 359, 359,
220, 231, 300, 359, 237, 359, 183, 359, 359, 359, 359, 359, 359, 359, 359,
359, 303, 359, 359, and 286, 355, 250, 105, 359, 359, 298, 359, 359, 359,
28.6, 359, 359) and 359, 128)  W = 485, p-value = 0.0002594 alternative
hypothesis: true location shift is not equal to 0 Warning message: In
wilcox.test.default(c(359, 359, 359, 359, 359, 359, 335, 359, : cannot
compute exact p-value with ties*


However, all of the online calculators find p-values close to 0.0025, 10x
the value output by R. All results are for a two-tailed case. Importantly,
the W value computed by R *does agree* with the U values output by the
first two online calculators listed above, yet it has a different p-value.

Can anyone shed some light on how and why R's calculation differs from that
of these online calculators? Thanks for your time.

____________________
W. Bradley Knox, PhD
http://bradknox.net
bradknox at mit.edu

	[[alternative HTML version deleted]]



More information about the R-help mailing list