[R] Wilcoxon Test
calandra at rgzm.de
Fri Apr 21 14:58:06 CEST 2017
Try setting the 'correct' argument to FALSE (similar to CORRECT=NO
option in the SAS documentation).
The p-values are then identical, although the W values are different.
Additionally I cannot understand why you get a warning from R that it
cannot compute exact p-values because of ties, while the SAS
documentation states that "Because the sample size is small, the
large-sample normal approximation might not be adequate, and it is
appropriate to compute the exact test."
And yet, the p-value from R is identical to the two-sided p-values with
the normal approximation...?!
Another oddity is the legend of the SAS output, which does not
correspond to the data in the output itself (but corresponds to the R
values with correct=TRUE)!
Could the SAS documentation have some errors? I don't have SAS installed
so cannot test the code.
Dr. Ivan Calandra
TraCEr, Laboratory for Traceology and Controlled Experiments
MONREPOS Archaeological Research Centre and
Museum for Human Behavioural Evolution
56567 Neuwied, Germany
+49 (0) 2631 9772-243
On 21/04/2017 14:37, Tripoli Massimiliano wrote:
> Dear R users,
> Why the result of Wilcoxon sum rank test by R is different from sas
> The code is next:
> sampleA <- c(1.94, 1.94, 2.92, 2.92, 2.92, 2.92, 3.27, 3.27, 3.27, 3.27,
> 3.7, 3.7, 3.74)
> sampleB <- c(3.27, 3.27, 3.27, 3.7, 3.7, 3.74)
> wilcox.test(A,B,paired = F)
> Thanks in advance
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help