title: Lillifors test in Python (wrong p-values)
body: <p>The code beneath, generates 1000 samples, of size 100, from normal distribution with mean =0 and sd=1, and for each sample it saves the p-value of the lillifors test for normality of each sample. </p>
  
  <pre><code>import numpy as np
  import statsmodels.api as sm
  b=1000
  pvalues=[0]*b
  for i in range(b): pvalues[i]=sm.stats.lillifors(np.random.normal(0,1,100))[1]
  </code></pre>
  
  <p>Then I take the maximum of all the p-values, which gives a result over 1, which means that there was at least one p-value over 1. How is it possible? Is it a bug or I'm doing something wrong?</p>
  
  <pre><code>print(np.max(pvalues))
  1.28471963277
  </code></pre>
  
  <p>In R the same procedure doesn't give strange results. Another thing that I noticed, is that Python allows the lillifors test to be performed for sample size lower than 5.</p>