[R] Query about wilcox.test() P-value
Peter Dalgaard
pdalgd at gmail.com
Wed Jul 14 23:17:22 CEST 2010
Marc Schwartz wrote:
> You need to understand the difference between how a value is stored
> in an R object with full floating point precision versus how a value
> in R is displayed (printed) in the console with a print "method".
>
> In this case, wilcox.test() returns an object of class 'htest' (as
> noted in the Value section of ?wilcox.test). When the result of
> wilcox.test() is printed to the console (using print.htest()), the p
> value is displayed using the function format.pval(), which in this
> case returns:
>
>> format.pval(2.928121e-165)
> [1] "< 2.22e-16"
>
> This is common in R, where floating point values are not printed to
> full precision. The value displayed will be impacted upon by various
> characteristics, in some cases due to the application of specific
> print/formatting operations, or due to default options in R (see
> ?print.default).
On the other hand, it should be admitted that this at least partly
originates in times when we were less careful about computing the
appropriate tail of test statistic distributions. So one main point was
that a p-value of 0 could arise as "1 minus a number very close to 1".
--
Peter Dalgaard
Center for Statistics, Copenhagen Business School
Phone: (+45)38153501
Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com
More information about the R-help
mailing list