Kolmogorov-Smirnov test

TIP OF THE DAY:
For Comparing two sample populations
While t-tests can be used to detect differences in the mean and Levene’s test can be used to detect differences in the variance, the Kolmogorov-Smirnov test can be used to detect a change either in the mean or the difference of even in the shape of the corresponding population distributions.
An example in R:

> s3<-c(1,5,3,9,2,6,7,9)

> s4<-c(5,5,1,10,4,12,3,3)

> ks.test(s3,s4)

Two-sample Kolmogorov-Smirnov test

data:  s3 and s4

D = 0.25, p-value = 0.964

alternative hypothesis: two-sided

Thus, the test shows that the null hypothesis (that the two samples come from the same distribution) can not be rejected.

Published by

Unknown's avatar

alitheia15

Data Mining-Analytics Software Consultant

2 thoughts on “Kolmogorov-Smirnov test”

Leave a reply to admin Cancel reply