0
$\begingroup$

How do I interpret the following output of the Kolmogorov-Smirnov [KS] test? [shown below, with reproducible example in R]

Also: Can the KS test be used for predictive model diagnostics?

x <- c(7.6,8.4,8.6,8.7,9.3,9.9,10.1,10.6,11.2) 
y <- c(5.2,5.7,5.9,6.5,6.8,8.2,9.1,9.8,10.8,11.3,11.5,12.3,12.5,13.4,14.6)
ks.test(x,y)

Resulting output:

Two-sample Kolmogorov-Smirnov test

data: x and y D = 0.4, p-value = 0.2653 alternative hypothesis: two-sided

$\endgroup$

migrated from stackoverflow.com Oct 29 '15 at 2:48

This question came from our site for professional and enthusiast programmers.

  • $\begingroup$ @thelatemail +1 for the "reading Wikipedia" recommendation. I can't bring myself, though, to drop this in the laps of the folks over at CV. $\endgroup$ – Josh O'Brien Oct 29 '15 at 1:49
  • $\begingroup$ Thanks @thelatemail. Just a clarification. I understand ks test explains whether two samples are significantly different or not. Can I give probabilistic distributions values to the ks test ? $\endgroup$ – karthik subramanian Oct 29 '15 at 2:43
  • $\begingroup$ Of course you can: any p-value results from a probability model for the sampling distribution of the test statistic ("D" in this case). But what exactly do you mean by "used for predictive model diagnostics"? $\endgroup$ – whuber Oct 29 '15 at 3:21
  • $\begingroup$ @whuber, what I meant was can I use ks test for a logistic regression or svm to evaluate a model ? $\endgroup$ – karthik subramanian Oct 29 '15 at 3:44
  • 1
    $\begingroup$ It is not evident what you are proposing to do. Obviously the KS test will not perform logistic regression for you. It is almost as obvious that it won't help you evaluate any of the assumptions of logistic regression. Exactly how do you propose applying it? What values would you test, relative to what other values, in a logistic regression setting? $\endgroup$ – whuber Oct 29 '15 at 3:48
-1
$\begingroup$

A P-Value of greater than 0.05 means that you cannot reject the null hypthesis that the two underlying distributions do not defer. <0.05 means that you can reject the null hypothesis that the distributions do not differ

$\endgroup$
  • 2
    $\begingroup$ This is a very basic answer but I don't think interpreting a p-value is the issue here. $\endgroup$ – Michael Chernick Mar 24 '18 at 22:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.