Skip to content

Commit ad60db1

Browse files
committed
fix
1 parent 13c696f commit ad60db1

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

R/check_overdispersion.R

+4-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,10 @@ check_overdispersion.glm <- function(x, verbose = TRUE, ...) {
164164
# for certain distributions, simulated residuals are more accurate
165165
use_simulated <- info$is_bernoulli || info$is_binomial || (!info$is_count && !info$is_binomial) || info$is_negbin
166166

167-
if (use_simulated) {
167+
# model classes not supported in DHARMa
168+
not_supported <- c("fixest", "glmx")
169+
170+
if (use_simulated && !inherits(x, not_supported)) {
168171
return(check_overdispersion(simulate_residuals(x, ...), ...))
169172
}
170173

R/check_zeroinflation.R

+4-1
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,12 @@ check_zeroinflation.default <- function(x, tolerance = 0.05, ...) {
6868
return(NULL)
6969
}
7070

71+
# model classes not supported in DHARMa
72+
not_supported <- c("fixest", "glmx")
73+
7174
# for models with zero-inflation component or negative binomial families,
7275
# we use simulated_residuals()
73-
if (model_info$is_zero_inflated || model_info$is_negbin) {
76+
if (!inherits(x, not_supported) && (model_info$is_zero_inflated || model_info$is_negbin)) {
7477
if (missing(tolerance)) {
7578
tolerance <- 0.1
7679
}

0 commit comments

Comments
 (0)