IMSL Statistics Reference Guide > Goodness of Fit > LILLIEFORS_NORMALITY_TEST Function (PV-WAVE Advantage)
  

LILLIEFORS_NORMALITY_TEST Function (PV-WAVE Advantage)
Performs a Lilliefors test for normality.
Usage
result = LILLIEFORS_NORMALITY_TEST (x)
Input Parameters
x—Array of size n_observations (number of observations) containing the observations.
Returned Value
result—The p-value for the Lilliefors test for normality. Probabilities less than 0.01 are reported as 0.01, and probabilities greater than 0.10 for the normal distribution are reported as 0.5.
Input Keywords
Double—If present and nonzero, then double precision is used.
Output Keywords
Max_difference—Scalar float containing the maximum absolute difference between the empirical and the theoretical distributions.
Discussion
This function computes Lilliefors test and its p-value for a normal distribution in which both the mean and variance are estimated. The one-sample, two-sided Kolmogorov-Smirnov statistic D is first computed. The p-value is then computed using an analytic approximation given by Dallal and Wilkinson (1986). Because Dallal and Wilkinson give approximations in the range (0.01, 0.10), if the computed probability of a greater D is less than 0.01, the Lilliefors test by convention calls for rejection and the p-value is set to 0.01. If the computed probability of a greater D is greater than 0.1, by convention the null hypothesis is accepted and the p-value is set to 0.50. Note that because parameters are estimated, p-value in Lilliefors test is not the same as in the Kolmogorov-Smirnov Test.
Observations should not be tied. If tied observations are found, an informational message is printed. A general reference for the Lilliefors test is Conover (1980). The original reference for the test for normality is Lilliefors (1967).
Example
This example is taken from Conover (1980, pp. 195, 364). The data consists of 50 two-digit numbers taken from a telephone book. The Lilliefors test fails to reject the null hypothesis of normality, i.e., p_value is greater than 0.1.
PRO t_lilliefors_normality_test 
 
  x = [$
      23.0, 36.0, 54.0, 61.0, 73.0, 23.0,$  
      37.0, 54.0, 61.0, 73.0, 24.0, 40.0,$
      56.0, 62.0, 74.0, 27.0, 42.0, 57.0,$
      63.0, 75.0, 29.0, 43.0, 57.0, 64.0,$
      77.0, 31.0, 43.0, 58.0, 65.0, 81.0,$
      32.0, 44.0, 58.0, 66.0, 87.0, 33.0,$
      45.0, 58.0, 68.0, 89.0, 33.0, 48.0,$
      58.0, 68.0, 93.0, 35.0, 48.0, 59.0,$
      70.0, 97.0] 
 
 
  p_value = LILLIEFORS_NORMALITY_TEST(x, $  
                  Max_difference=max_diff) 
 
  PRINT,"" 
  PRINT,"p-value = ",STRING(p_value,Format="(f11.4)") 
  PRINT,"max difference = ", $
         STRING(max_diff,Format="(f11.6)") 
END
Output
% LILLIEFORS_NORMALITY_TEST: Warning: STAT_TWO_OR_MORE_TIED
        Two or more elements in "X" are tied.
% LILLIEFORS_NORMALITY_TEST: Note: STAT_PROB_GT_TENTH
        The computed probability is greater than 0.10. Probability is set to 0.50.
 
p-value =      0.5000
max difference =    0.081071
Warning Errors
STAT_TWO_OR_MORE_TIED—Two or more elements in “x” are tied.
Fatal Errors
STAT_NEED_AT_LEAST_5—All but # elements of “x” are missing. At least five non­missing observations are necessary to continue.
STAT_NEG_IN_EXPONENTIAL—In testing the exponential distribution, an invalid element in “x” is found (“x” = #). Negative values are not possible in exponential distributions.
STAT_NO_VARIATION_INPUT—There is no variation in the input data. All nonmissing observations are tied.

Version 2017.0
Copyright © 2017, Rogue Wave Software, Inc. All Rights Reserved.