Draws a residual-density plot and reports a Shapiro-Wilk test. The test is defined for 3 to 5000 observations.

normality_check(mdl)

Arguments

mdl

A fitted model with a stats::residuals() method.

Value

A ggplot object with the Shapiro-Wilk test stored in its sfl_test attribute.

Examples

if (FALSE) { # \dontrun{
model <- stats::lm(mpg ~ wt, data = mtcars)
normality_check(model)
} # }