Skip to content

Commit

Permalink
use halfnorm properly
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Feb 5, 2024
1 parent 93ddedc commit dcbc21e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions R/check_model.R
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ check_model.model_fit <- function(x,
dat <- list()

dat$VIF <- .diag_vif(model, verbose = verbose)
dat$QQ <- .diag_qq(model, verbose = verbose)
dat$QQ <- .diag_qq(model, model_info = model_info, verbose = verbose)

Check warning on line 343 in R/check_model.R

View check run for this annotation

Codecov / codecov/patch

R/check_model.R#L343

Added line #L343 was not covered by tests
dat$REQQ <- .diag_reqq(model, level = 0.95, model_info = model_info, verbose = verbose)
dat$NORM <- .diag_norm(model, verbose = verbose)
dat$NCV <- .diag_ncv(model, verbose = verbose)
Expand All @@ -367,7 +367,7 @@ check_model.model_fit <- function(x,
dat <- list()

dat$VIF <- .diag_vif(model, verbose = verbose)
dat$QQ <- .diag_qq(model, verbose = verbose)
dat$QQ <- .diag_qq(model, model_info = model_info, verbose = verbose)
dat$HOMOGENEITY <- .diag_homogeneity(model, verbose = verbose)
dat$REQQ <- .diag_reqq(model, level = 0.95, model_info = model_info, verbose = verbose)
dat$OUTLIERS <- check_outliers(model, method = "cook")
Expand Down
4 changes: 2 additions & 2 deletions R/check_model_diagnostics.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

# prepare data for QQ plot ----------------------------------

.diag_qq <- function(model, verbose = TRUE) {
.diag_qq <- function(model, model_info = NULL, verbose = TRUE) {
if (inherits(model, c("lme", "lmerMod", "merMod", "gam"))) {
res_ <- stats::residuals(model)
} else if (inherits(model, "geeglm")) {
Expand Down Expand Up @@ -63,7 +63,7 @@
return(NULL)
}

if (inherits(model, "glm")) {
if (inherits(model, c("glm", "glmerMod")) || (inherits(model, "glmmTMB") && isFALSE(model_info$is_linear))) {
fitted_ <- stats::qnorm((stats::ppoints(length(res_)) + 1) / 2)
} else {
fitted_ <- stats::fitted(model)
Expand Down

0 comments on commit dcbc21e

Please sign in to comment.