Learn R Programming

performance (version 0.2.0)

check_normality: Check model for (non-)normality of residuals.

Description

Check model for (non-)normality of residuals.

Usage

check_normality(x, ...)

Arguments

x

A model object.

...

Currently not used.

Value

Invisibly returns the p-value of the test statistics. A p-value < 0.05 indicates a significant deviation from normal distribution

Details

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.

Examples

Run this code
# NOT RUN {
m <- lm(mpg ~ wt + cyl + gear + disp, data = mtcars)
check_normality(m)

# }

Run the code above in your browser using DataLab