Class Lilliefors
- java.lang.Object
-
- dev.nm.stat.test.HypothesisTest
-
- dev.nm.stat.test.distribution.normality.Lilliefors
-
public class Lilliefors extends HypothesisTest
Lilliefors test tests the null hypothesis that data come from a normally distributed population with an estimated sample mean and variance. The test statistic is the maximal absolute difference between empirical and the hypothetical Normal distribution function. Since the hypothesized cdf has been moved closer to the data by estimation based on the data, the "null distribution" of the test statistic, i.e. its probability distribution assuming the null hypothesis is true, is stochastically smaller than the Kolmogorov-Smirnov distribution, hence the Lilliefors distribution. In this implementation, we first compute the p-value from the Dallal-Wilkinson (1986) formula, which is claimed to be only reliable when the p-value is smaller than 0.1. When this p-value is > 0.1, we compute again the p-value from the distribution of the modified statistic (Stephen 1974). The R equivalent function islillie.testin packagenortest.- See Also:
- G. E. Dallal, L. Wilkinson, "An analytic approximation to the distribution of Lilliefors' test for normality," The American Statistician, 40, 294-296, 1986.
- M. A. Stephens, "EDF statistics for goodness of fit and some comparisons," Journal of the American Statistical Association, 69, 730-737, 1974.
- Wikipedia: Lilliefors test
-
-
Constructor Summary
Constructors Constructor Description Lilliefors(double[] sample)Perform the Lilliefors test to test for the null hypothesis that data come from a normally distributed population with an estimated sample mean and variance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetAlternativeHypothesis()Get the description of the alternative hypothesis.StringgetNullHypothesis()Get a description of the null hypothesis.doublepValue()Get the p-value for the test statistics.doublestatistics()Get the test statistics.-
Methods inherited from class dev.nm.stat.test.HypothesisTest
isNullRejected, nGroups, nObs, oneSidedPvalue
-
-
-
-
Method Detail
-
getNullHypothesis
public String getNullHypothesis()
Description copied from class:HypothesisTestGet a description of the null hypothesis.- Specified by:
getNullHypothesisin classHypothesisTest- Returns:
- the null hypothesis description
- See Also:
- Wikipedia: Null hypothesis
-
getAlternativeHypothesis
public String getAlternativeHypothesis()
Description copied from class:HypothesisTestGet the description of the alternative hypothesis.- Specified by:
getAlternativeHypothesisin classHypothesisTest- Returns:
- the alternative hypothesis description
- See Also:
- Wikipedia: Alternative hypothesis
-
statistics
public double statistics()
Description copied from class:HypothesisTestGet the test statistics.- Specified by:
statisticsin classHypothesisTest- Returns:
- the test statistics
- See Also:
- Wikipedia: Test statistic
-
pValue
public double pValue()
Description copied from class:HypothesisTestGet the p-value for the test statistics.- Specified by:
pValuein classHypothesisTest- Returns:
- the p-value
- See Also:
- Wikipedia: P-value
-
-