Skip to content

Commit

Permalink
try
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Mar 16, 2024
1 parent 825d456 commit 4d00962
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions R/check_model_diagnostics.R
Original file line number Diff line number Diff line change
Expand Up @@ -298,14 +298,12 @@

simres <- simulate_residuals(model, ...)
predicted <- simres$fittedPredictedResponse
# d <- data.frame(Predicted = stats::predict(model, type = "response"))
d <- data.frame(Predicted = predicted)

Check warning on line 301 in R/check_model_diagnostics.R

View check run for this annotation

Codecov / codecov/patch

R/check_model_diagnostics.R#L299-L301

Added lines #L299 - L301 were not covered by tests

# residuals based on simulated residuals - but we want normally distributed residuals
d$Residuals <- stats::residuals(simres, quantileFunction = stats::qnorm, ...)
d$Res2 <- d$Residuals^2
# standard residuals: residuals / sqrt(mse)
d$StdRes <- d$Residuals / sqrt(mean(d$Res2, na.rm = TRUE))
d$StdRes <- insight::get_residuals(model, type = "pearson")

Check warning on line 306 in R/check_model_diagnostics.R

View check run for this annotation

Codecov / codecov/patch

R/check_model_diagnostics.R#L304-L306

Added lines #L304 - L306 were not covered by tests

# data for poisson models
if (faminfo$is_poisson && !faminfo$is_zero_inflated) {
Expand Down

0 comments on commit 4d00962

Please sign in to comment.