Skip to content

Commit

Permalink
close #613
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Mar 15, 2024
1 parent 764dcdf commit 7d80db4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion R/check_normality.R
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ check_normality.merMod <- function(x, effects = c("fixed", "random"), ...) {
# valid model?
if (!info$is_linear && effects == "fixed") {
insight::format_alert(
"Checking normality of residuals is only appropriate for linear models."
"Checking normality of residuals is only appropriate for linear models. It is recommended to use `simulate_residuals()` and `check_residuals()` to check generalized linear (mixed) models for uniformity of residuals." # nolint
)
return(NULL)
}
Expand Down Expand Up @@ -217,6 +217,8 @@ check_normality.merMod <- function(x, effects = c("fixed", "random"), ...) {
attr(p.val, "type") <- "random effects"
attr(p.val, "re_groups") <- re_groups
}
} else if (inherits(x, "glmmTMB")) {
p.val <- .check_normality(stats::residuals(x, type = "deviance"), x)
} else {
# check for normality of residuals
p.val <- .check_normality(stats::rstudent(x), x)
Expand Down

0 comments on commit 7d80db4

Please sign in to comment.