[R] about a p-value < 2.2e-16
Viechtbauer, Wolfgang (SP)
wo||g@ng@v|echtb@uer @end|ng |rom m@@@tr|chtun|ver@|ty@n|
Fri Mar 19 16:17:56 CET 2021
Dear Jiefei,
This behavior is documented. From help(wilcox.test):
"By default (if exact is not specified), an exact p-value is computed if the samples contain less than 50 finite values and there are no ties. Otherwise, a normal approximation is used."
Best,
Wolfgang
>-----Original Message-----
>From: R-help [mailto:r-help-bounces using r-project.org] On Behalf Of Jiefei Wang
>Sent: Friday, 19 March, 2021 15:52
>To: Spencer Graves
>Cc: r-help; Bogdan Tanasa
>Subject: Re: [R] about a p-value < 2.2e-16
>
>After digging into the R source, it turns out that the argument `exact` has
>nothing to do with the numeric precision. It only affects the statistic
>model used to compute the p-value. When `exact=TRUE` the true distribution
>of the statistic will be used. Otherwise, a normal approximation will be
>used.
>
>I think the documentation needs to be improved here, you can compute the
>exact p-value *only* when you do not have any ties in your data. If you
>have ties in your data you will get the p-value from the normal
>approximation no matter what value you put in `exact`. This behavior should
>be documented or a warning should be given when `exact=TRUE` and ties
>present.
>
>FYI, if the exact p-value is required, `pwilcox` function will be used to
>compute the p-value. There are no details on how it computes the pvalue but
>its C code seems to compute the probability table, so I assume it computes
>the exact p-value from the true distribution of the statistic, not a
>permutation or MC p-value.
>
>Best,
>Jiefei
More information about the R-help
mailing list