```Date: Dec 24, 2012 12:04 PM
Author: Luis A. Afonso
Subject: Re: kolmogov-smirnov, wilcoxon and kruskal tests

It was asked to say something about:Date: Dec 22, 2012 8:22 PMAuthor: czytaczgrup@gmail.comSubject: kolmogov-smirnov, wilcoxon and kruskal testsHi Everybody, I'm trying to do some hypotheses testing in R and I have problems with interpretation of results. I have two data sets:   x<-c(2,1,1,2,2,3,2,2,1,2,2,4,1,2,4,1,1,5,2,1,4,2,2,1,1,2,2,1)      y<-c(2,2,1,1,2,2,1,4,1,4,2,4,4,4,3,2,4,4,3,2,4,5) according to the KS test they come from the same distribution: ks.test(x,y) If they come from the same distribution all the characteristics (mean, median, ... ) should be the same. However,  Wicoxon and Kruskal tests indicate that their null hypothesis should be rejectedwilcox.test(x,y)kruskal.test(list(x,y)) Now, I am puzzled with the outcome of the test. I can simply imagine a situation when Wilcox and Kruskal tests indicate that their null hypothesis should be accepted but the KS test can indicate that samples comes from different distributions. Here, it is the other way round. Does any one has some hints what causes the problems? Best, Gruppo________________________________My CommentTill yesterday I did suppose that all indication of rank statistics regarding the Two-sample Kolmogorov-Smirnov Test was complete idiotic. Facing the following Richard Ulrich?s response I?m not so sure . . .(Irony?s somewhat a lighter way to disapprove . . . I mean. Christmas Time . . .)Luis A. Afonso______________________________________Date: Dec 23, 2012 4:31 PMAuthor: Richard UlrichSubject: Re: kolmogov-smirnov, wilcoxon and kruskal testsOn Sat, 22 Dec 2012 21:27:54 -0800 (PST), Ray Koopman <koopman@sfu.ca>wrote:>On Dec 22, 5:22 pm, czytaczg...@gmail.com wrote: >> [...]>>>> according to the KS test they come from the same distribution: >>NO. You misunderstand the logic of hypothesis testing. Failing to>reject a hypothesis does not mean that it is true or that you should>act as if it were true. It means only that, in the way that the test>looks at data, your data are not inconsistent with the hypothesis. >Other tests, that look at the data differently, may well disagree. Good statement. I'll just add that these so-called non-parametric tests are based on ranks, and their usual tests are calculated on thebasis of "no ties" -- That certainly does not characterize these data, with 50 scores from 1 to 5.  It is conceivable that a Monte-carlo test of KS, done by generating 10,000 samples with the same margins, would show that the KS test-outcome *is*  an unusual one.  Or it might not.  It seems to me, though I'm not entirely sure, that the KS test is fundamentally testing the number of "interchanges" in ranks (which is a linear metric), whereas the other two tests are measuring the squared differences in ranks.  So, he tests may disagree because they are testing two different ways to measure the non-fit. For these data, I would be willing to report the means as meaningful ... and thus, using that as a guide, I would be willing to use the ordinary t-test for comparison?Rich Ulrich
```