Check model for (non-)normality of residuals.Source:
Check model for (non-)normality of residuals.
check_normality(x, ...) # S3 method for merMod check_normality(x, effects = c("fixed", "random"), ...)
A model object.
Currently not used.
Should normality for residuals (
"fixed") or random effects (
"random") be tested? Only applies to mixed-effects models. May be abbreviated.
The p-value of the test statistics. A p-value < 0.05 indicates a significant deviation from normal distribution.
stats::shapiro.test and checks the
standardized residuals (or studentized residuals for mixed models) 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. For generalized linear models, no formal
statistical test is carried out. Rather, there's only a
plot() method for
GLMs. This plot shows a half-normal Q-Q plot of the absolute value of the
standardized deviance residuals is shown (in line with changes in
plot.lm() for R 4.3+).