P value for Normality test very small despite normal histogram
<p>I've looked over the normality tests in scipy stats for both <a href="http://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.stats.mstats.normaltest.html" rel="nofollow">scipy.stats.mstats.normaltest</a> as well as <a href="http://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.shapiro.html" rel="nofollow">scipy.stats.shapiro</a> and it looks like they both assume the null hypothesis is that the data they're given is normal.</p>

<p>Ie, a p value less than .05 would indicate that they're not normal.  </p>

<p>I'm doing a regression with LassoCV in SKLearn, and in order to give myself better results I log transformed the answers, which gives a histogram that looks like this:</p>

<p><a href="http://i.stack.imgur.com/poo2E.png" rel="nofollow"><img src="http://i.stack.imgur.com/poo2E.png" alt="Histogram of data"></a></p>

<p>Looks normal to me.  </p>

<p>However, when I run the data through either of the two tests mentioned above I get very small p values that would indicate the data is not normal, and in a big way.</p>

<p>This is what I get when I use scipy.stats.shapiro</p>

<pre><code>scipy.stats.shapiro(y)
Out[69]: (0.9919402003288269, 3.8889791653673456e-07)
</code></pre>

<p>And I get this when I run scipy.stats.mstats.normaltest:</p>

<pre><code>scipy.stats.mstats.normaltest(y)
NormaltestResult(statistic=25.755128535282189, pvalue=2.5547293546709236e-06)
</code></pre>

<p>It seems implausible to me that my data would test out as being so far from normality with the histogram it has.</p>

<p>Is there something causing this discrepancy, or am I not interpreting the results correctly?</p>

<p>If the numbers on the vertical axis are the number of observations for the respective class, then the sample size is about 1500. For such a large sample size goodness-of-fit tests are rarely useful. But is it really necessary that your data is perfectly normally distributed? If you want to analyze the data with a statistical method, is this method maybe robust under ("small") deviations from the normal distribution assumption? 
In practice the question is usually "Is the normal distribution assumption acceptable" for my statistical analysis. A perfect normal distribution is very rarly available. 
An additional comment on histograms: One has to be careful by interpreting data from histograms because if the data "looks normal" or not may depend on the width of the histogram classes. Histograms are only hints which should be treated with caution.</p>

python numpy scipy statistics