
Last chance! 50% off unlimited learning
Sale ends in
Check model for (non-)normality of residuals.
check_normality(x, ...)
A model object.
Currently not used.
Invisibly returns the p-value of the test statistics. A p-value < 0.05 indicates a significant deviation from normal distribution
check_normality()
calls shapiro.test
and checks the standardized residuals for normal distribution. Note that
this formal test almost always yields significant results for the distribution
of residuals and visual inspection (e.g. Q-Q plots) are preferable.
# NOT RUN {
m <- lm(mpg ~ wt + cyl + gear + disp, data = mtcars)
check_normality(m)
# plot results
x <- check_normality(m)
plot(x)
# }
# NOT RUN {
# QQ-plot
plot(check_normality(m), type = "qq")
# PP-plot
plot(check_normality(m), type = "pp")
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab