Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Mar 16, 2024
1 parent 3d5844d commit 25f2a16
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions R/check_overdispersion.R
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,18 @@ check_overdispersion.glm <- function(x, verbose = TRUE, ...) {
return(check_overdispersion(simulate_residuals(x, ...), ...))

Check warning on line 171 in R/check_overdispersion.R

View check run for this annotation

Codecov / codecov/patch

R/check_overdispersion.R#L171

Added line #L171 was not covered by tests
}

# check if we have poisson - need this for models not supported by DHARMa
if (!info$is_count && !info$is_binomial) {
insight::format_error(
"Overdispersion checks can only be used for models from Poisson families or binomial families with trials > 1."
)
}

# check for Bernoulli
if (info$is_bernoulli) {
insight::format_error("Overdispersion checks cannot be used for Bernoulli models.")
}

yhat <- stats::fitted(x)

n <- stats::nobs(x)
Expand Down

0 comments on commit 25f2a16

Please sign in to comment.