Skip to content
Prev 154896 / 398503 Next

Normality test

On 03/09/2008 10:33 AM, Williams, Robin wrote:
Raw data that is suitable for standard linear regression is normally 
distributed, but the mean varies from observation to observation.  The 
necessary assumption is that the errors are normally distributed with 
zero mean, but the data itself also includes the non-random parts of the 
model.  The effect of the varying means is that the data will generally 
*not* appear to come from a normal distribution if you just throw it all 
into a vector and look at it.

So let's assume you're working with residuals from a linear fit.  The 
residuals should be normally distributed with mean zero, but their 
variances won't be equal.  It may be that in a large dataset this will 
be enough to get a false declaration of non-normality even with 
perfectly normal errors.  In a small dataset you'll rarely have enough 
power to detect non-normality.

So overall, don't use something like shapiro.test for what you have in 
mind.  Any recent regression text should give advice on model 
diagnostics that will do a better job.
A low p-value (e.g. p < 0.05) could suggest there is evidence of 
non-normality, but p > 0.05 just shows a lack of evidence.  In the case 
where the data is truly normally distributed, you'd expect p to be 
uniformly distributed between 0 and 1.  (I have an article in the 
current American Statistician suggesting ways to teach p-values to 
emphasize this; unfortunately, it seems to be a surprise to a lot of 
people.)

Duncan Murdoch

As a test I did