Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Topic: kolmogov-smirnov, wilcoxon and kruskal tests
Replies: 14   Last Post: Dec 31, 2012 6:38 PM

 Messages: [ Previous | Next ]
 Luis A. Afonso Posts: 4,758 From: LIsbon (Portugal) Registered: 2/16/05
Re: kolmogov-smirnov, wilcoxon and kruskal tests
Posted: Dec 24, 2012 12:04 PM

Date: Dec 22, 2012 8:22 PM
Author: czytaczgrup@gmail.com
Subject: kolmogov-smirnov, wilcoxon and kruskal tests

Hi 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 rejected

wilcox.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 Comment

Till 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 PM
Author: Richard Ulrich
Subject: Re: kolmogov-smirnov, wilcoxon and kruskal tests

On 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

Date Subject Author
12/22/12 czytaczgrup@gmail.com
12/23/12 Ray Koopman
12/23/12 czytaczgrup@gmail.com
12/23/12 Richard Ulrich
12/23/12 Ray Koopman
12/23/12 Luis A. Afonso
12/24/12 Luis A. Afonso
12/29/12 illywhacker
12/29/12 Richard Ulrich
12/30/12 czytaczgrup@gmail.com
12/30/12 Richard Ulrich
12/31/12 Herman Rubin
12/31/12 Richard Ulrich
12/31/12 Herman Rubin
12/31/12 illywhacker