# Understanding the Shapiro-Wilk normality test

I am trying to learn how to check if the distribution of values in a set is normal or not. Making a histogram and a boxplot shows:

Performing the hapiro-Wilk normality test I get:

    Shapiro-Wilk normality test

data:  residuals(lmMod)
W = 0.94509, p-value = 0.02152


Am I correct if I interpret this as: Shapiro-Wilk normality test's H0 is that the population is normally distributed. Because the p-value is less than 0.05 this can be rejected as the chance that the population is normally distributed is too low. Short: The data is not normally distributed?

• Strictly speaking, this test is not applicable to a dataset of regression residuals because those residuals are not independent. More to the point, one usually does not apply a formal test of normality to any residuals, because the objective is to assess the inevitable deviation from normality to see whether related decisions, such as about confidence limits of regression parameters (etc.) can be trusted. The SW test is irrelevant for that purpose. See stats.stackexchange.com/questions/15651 for a discussion of what to look for in residuals.
– whuber
May 18, 2020 at 13:33
• @whuber thanks for that addition. How would I then check for a normal distribution of the residuals as when they are assumed to be normally distributed by a model? May 18, 2020 at 13:48
• A normal probability plot is powerful and insightful.
– whuber
May 18, 2020 at 13:57
• @whuber is there any difference there in using a pp or a qq plot? May 18, 2020 at 14:10
• Yes. For examining residuals, you usually want to view a plot that uses their actual values: that would be the QQ plot.
– whuber
May 18, 2020 at 14:23