Lilliefors test
Goodness of fit and normality · reference distribution: D (Lilliefors)
When to use it
Test normality when the mean and standard deviation are estimated from the sample itself.
Null hypothesis
The data come from some normal distribution.
Assumptions
- Independent observations
Test statistic
D = \sup_x \left| F_n(x) - \Phi\!\left(\dfrac{x - \bar{x}}{s}\right) \right|How to report it
D = 0.09, p = .38
In R and Python
R
library(nortest)
lillie.test(x)
Python
from statsmodels.stats.diagnostic import lilliefors
lilliefors(x)
In Python, stats is scipy.stats and np is numpy.
Variants and alternatives
- Kolmogorov-Smirnov with corrected critical values
Where it sits in the catalog
Goodness of fit and normality. Goodness of fit: do the data follow the expected distribution? Normality tests are the most common case and check an assumption of parametric tests.
In the decision tree
It has no path of its own in the tree, but appears alongside other tests:
- As an alternative to Shapiro-Wilk.