Re: [R] Weird differing results when using the Wilcoxon-test

2010-08-18 Thread peter dalgaard
On Aug 18, 2010, at 11:55 AM, Cedric Laczny wrote: > I was able to trace down the unexpected behavior to the following line > SIGMA <- sqrt((n.x * n.y/12) * ((n.x + n.y + 1) - >sum(NTIES^3 - NTIES)/((n.x + n.y) * (n.x + n.y - > 1 > My calculations of the Z-s

Re: [R] Weird differing results when using the Wilcoxon-test

2010-08-18 Thread Cedric Laczny
I was able to trace down the unexpected behavior to the following line SIGMA <- sqrt((n.x * n.y/12) * ((n.x + n.y + 1) - sum(NTIES^3 - NTIES)/((n.x + n.y) * (n.x + n.y - 1 My calculations of the Z-score for the normal approximation where based on using the s

Re: [R] Weird differing results when using the Wilcoxon-test

2010-08-17 Thread Cedric Laczny
Thanks for the hint. I tested this generic example and had the same behavior also in a special example, that can be found below. This example does not involve continuity correction but exibits the same "unexpected" behavior: GDS_example = function() { print("---> GDS EXAMPLE <---", quote

Re: [R] Weird differing results when using the Wilcoxon-test

2010-08-17 Thread Thomas Lumley
After fixing the parentheses in your code so it does run, it seems that the difference is that wilcox.test defaults to using a continuity correction and your manual calculation does not. Use wilcox.test(big1, big2, correct=FALSE). -thomas On Tue, 17 Aug 2010, Cedric Laczny wrote: Hi,

[R] Weird differing results when using the Wilcoxon-test

2010-08-17 Thread Cedric Laczny
Hi, I became a little bit confused when working with the Wilcoxon test in R. As far as I understood, there are mainly two versions: 1) wilcox.test{stats}, which is the default and an approximation, especially, when ties are involved 2) wilcox_test{coin}, which does calculate the distribution _exa