# Interpretation of Kolmogorov-Smirnov test result

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

• @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. Oct 29, 2015 at 1:49
• 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 ?
– karthik subramanian
Oct 29, 2015 at 2:43
• 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"?
– whuber
Oct 29, 2015 at 3:21
• @whuber, what I meant was can I use ks test for a logistic regression or svm to evaluate a model ? Oct 29, 2015 at 3:44
• 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?
– whuber
Oct 29, 2015 at 3:48