[R] BIZARRE results from wilcox.test()

Daniel Malter daniel at umd.edu
Tue Jun 14 23:55:04 CEST 2011


I would argue that your Wilcoxon test is meaningless. For all four datasets,
the first data column has no overlap whatsoever with the second data column.
All Wilcoxon Ws are 0. The "BIZARRE" behavior may be that the test tries to
interpolate what the p value for W of 0 would be given your sample size.
With your sample size, the Wilcoxon test may use a normal approximation,
which might explain this behavior
(http://en.wikipedia.org/wiki/Mann–Whitney_U#Normal_approximation) you would
have to check it yourself.

If you create overlap by, say, adding the mean of the first data column to
all observations in the second data column, you have overlap between the
data columns. Only then it makes sense to run a Wilcoxon test and you get
what you would expect. In your instance, it is nonsensical to perform a
Wilcoxon test. That is the likely reason for the p-value issue you observe.

w <- wilcox.test(c(1:40),(c(1:40)+20.5)) 
w$p.value 

w <- wilcox.test(c(1:50),(c(1:50)+25.5)) 
w$p.value 

w <- wilcox.test(c(1:60),(c(1:60)+30.5)) 
w$p.value 

w <- wilcox.test(c(1:70),(c(1:70)+35.5)) 
w$p.value 


--
View this message in context: http://r.789695.n4.nabble.com/BIZARRE-results-from-wilcox-test-tp3597818p3597936.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list