Fundamentals of Statistics contains material of various lectures and courses of H. Lohninger on statistics, data analysis and here for more.

Kolmogorov-Smirnov One-Sample Test

A frequent problem is the verification that a predefined probability distribution represents the population of the data in question. While the chi-square test is applicable only to a larger number of data (> 30), the Kolmogorov-Smirnov test can be applied to smaller samples. However, keep in mind that the power of both the chi-square test and the Kolmogorov-Smirnov test is quite low. An alternative offering higher statistical power would be the Shapiro-Wilk test .

Note: Do not confuse the Kolmogorov-Smirnov one-sample test with the two-sample test, which tests whether two independent samples are from the same distribution.

The objective of the Kolmogorov-Smirnov test is to test whether a sample of a random variable belongs to a predefined distribution. The null hypothesis must therefore specify both the type of distribution function and its parameters (the null hypothesis states that the sample belongs to the distribution specified). The alternative hypothesis is that the assumed probability distribution function does not match the underlying one (type of function and/or are parameters wrong). The idea behind the Kolmogorov-Smirnov test is quite simple: the maximum difference between the assumed cumulative pdf and the random sample to be investigated is used to decide whether the random sample belongs to the distribution or not.

One of the prerequisites of the KS test is that the parameters of the reference distribution (mean and standard deviation in the case of a normal distribution) are exactly known - which is seldomly true in practical applications, as the parameters are most often estimated from the sample. In this case the KS test is too conservative (i.e. the actual level of significance is lower than the chosen one, thus the null hypothesis is rejected less often than theoretically possible). Lilliefors has proposed an adjustment of the critical limits to cope with this problem (the KS test with adjusted critical limits is also known as Lilliefors test).

Use the DataLab to perform the Kolmogorov-Smirnov test for normality of your own data set.