[R] Query about wilcox.test() P-value
Govind Chandra
govind.chandra at bbsrc.ac.uk
Wed Jul 14 11:53:58 CEST 2010
Hi,
I find that the p-value printed out by wilcox.test() and the p-value
stored in the p.value attribute in the object returned by
wilcox.test() are not the same. There seems to be a lower limit of
2.2e-16 for the printed value although it does say that it is less
than that. What I want to know is the reason for the lower limit in
the printed value of p-value and also whether I am doing the right
thing by picking up the p-value from the p.value attribute of the
returned object. An example R session is pasted below (although the
test is probably not the right one for the kind of data).
> x <- rnorm(500, mean = 30, sd = 3);
> y <- rnorm(500, mean = 8000, sd = 6);
> wilcox.test(x, y, alternative = "l");
Wilcoxon rank sum test with continuity correction
data: x and y
W = 0, p-value < 2.2e-16
alternative hypothesis: true location shift is less than 0
> wt <- wilcox.test(x, y, alternative = "l");
> wt$p.value;
[1] 2.928121e-165
My version for R is 2.11.1 (2010-05-31) running on x86_64 GNU/Linux
(RHEL).
Thanks in advance for any help with this.
Govind
More information about the R-help
mailing list