Skip to contents

Kolmogorov-Smirnov statistic referred to Lilliefors's null distribution rather than Kolmogorov's. When the parameters are estimated from the same sample the ordinary K-S critical values are badly conservative, which is what Lilliefors (1967) established; the correct points come from separate simulations, tabulated for the normal case and for the exponential case.

Usage

lilliefors_test(x, dist = c("norm", "expon"))

Arguments

x

Numeric vector.

dist

Either "norm" (default, mean and variance unknown) or "expon" (mean unknown).

Value

A morie_test_result (subclass of morie_rich_result) with the Lilliefors D statistic, p-value, and sample size n. extra$p_bounded is "upper" or "lower" when D falls outside the tabulated range, in which case the p-value is the nearest tabulated bound (0.10 or 0.001) rather than an exact value.

References

Lilliefors, H. W. (1967). On the Kolmogorov-Smirnov test for normality with mean and variance unknown. Journal of the American Statistical Association, 62(318), 399-402.

Lilliefors, H. W. (1969). On the Kolmogorov-Smirnov test for the exponential distribution with mean unknown. Journal of the American Statistical Association, 64(325), 387-389.

Gibbons, J. D. & Chakraborti, S. (2010). Nonparametric Statistical Inference, 5th edn. CRC Press. Sections 4.5-4.6, Tables O and T.

Examples

set.seed(1)
res <- lilliefors_test(rnorm(80))
res
#> Lilliefors test (norm)
#> ----------------------
#>   statistic = 0.0569086
#>   p-value   = 0.753847
#>   n         = 80
lilliefors_test(rexp(80), dist = "expon")$p_value
#> [1] 0.1