MerQuR+Statistics Glossary

Statistics Glossary → Kolmogorov-Smirnov test and Lilliefors correction

Kolmogorov-Smirnov test and Lilliefors correctionconcept

A goodness-of-fit test that compares a sample's cumulative distribution with a theoretical distribution (or two samples with each other) through their largest vertical distance.

In the one-sample test the statistic is D = max |F_n(x) - F_0(x)|, where F_n is the empirical cumulative distribution function of the sample and F_0 is the theoretical distribution being tested. The two-sample version uses the largest difference between two empirical distribution functions and is sensitive to any difference in the shape of the distributions, not only in their means.

The classical K-S table assumes the parameters of the theoretical distribution are known in advance. When the mean and standard deviation of a normal distribution are estimated from the same data, that table gives p values that are far too conservative; the Lilliefors correction uses the appropriate distribution for this case. For testing normality, K-S generally has lower power than Shapiro-Wilk and is more sensitive in the centre of the distribution than in its tails.

An everyday example

A bus company claims that the gaps between bus arrivals follow an exponential distribution. The cumulative distribution of 200 gaps is drawn on the same chart as the exponential curve, and the largest vertical gap between the two curves is 0.04. A difference this small suggests the data are consistent with an exponential distribution.

In MerQur

In the Normality Tests, 'One-sample K-S, other distributions' tests against uniform, exponential and Poisson distributions, with the 'K-S p (parameter from data)' option (Monte Carlo or asymptotic). The 'Kolmogorov-Smirnov' checkbox of the One-Sample t-Test does not apply the Lilliefors correction; the Mann-Whitney U test offers the two-sample K-S as an extra output.

Analyses where this concept appears

Normality TestsOne-Sample t-TestPaired t-TestMann-Whitney U

Related concepts

Shapiro-Wilk test