Skip to content

Commit

Permalink
wonky plot from check_model() on a glmmTMB example
Browse files Browse the repository at this point in the history
Fixes #654
  • Loading branch information
strengejacke committed Feb 5, 2024
1 parent 082f9e8 commit b4cf7a7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion R/check_model.R
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ check_model.model_fit <- function(x,
dot_alpha = 0.8,
colors = c("#3aaf85", "#1b6ca8", "#cd201f"),
theme = "see::theme_lucid",
detrend = FALSE,
detrend = TRUE,
show_dots = NULL,
bandwidth = "nrd",
type = "density",
Expand Down
4 changes: 3 additions & 1 deletion R/check_model_diagnostics.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,12 @@
# prepare data for QQ plot ----------------------------------

.diag_qq <- function(model, verbose = TRUE) {
if (inherits(model, c("lme", "lmerMod", "merMod", "glmmTMB", "gam"))) {
if (inherits(model, c("lme", "lmerMod", "merMod", "gam"))) {
res_ <- stats::residuals(model)
} else if (inherits(model, "geeglm")) {
res_ <- stats::residuals(model, type = "pearson")
} else if (inherits(model, "glmmTMB")) {
res_ <- stats::residuals(model, type = "deviance")
} else if (inherits(model, "glm")) {
res_ <- .safe(abs(stats::rstandard(model, type = "deviance")))
} else {
Expand Down

0 comments on commit b4cf7a7

Please sign in to comment.