Skip to content

Commit

Permalink
Merge branch 'main' into JOSE_paper
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Oct 3, 2023
2 parents 273be72 + 198578d commit b26b139
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/html-5-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ on:
pull_request:
branches: [main, master]

name: HTML5 check
name: html-5-check

jobs:
HTML5-check:
html-5-check:
uses: easystats/workflows/.github/workflows/html-5-check.yaml@main
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: performance
Title: Assessment of Regression Models Performance
Version: 0.10.5.4
Version: 0.10.5.5
Authors@R:
c(person(given = "Daniel",
family = "Lüdecke",
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
the previous method, which used `parallel::detectCores()`. Now you should
set the number of cores via `options(mc.cores = 4)`.

## Bug fixes

* Fixed issues is `check_model()` for models that used data sets with
variables of class `"haven_labelled"`.

# performance 0.10.5

## Changes to functions
Expand Down
14 changes: 7 additions & 7 deletions R/check_model_diagnostics.R
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
# prepare data for normality of residuals plot ----------------------------------

.diag_norm <- function(model, verbose = TRUE) {
r <- try(stats::residuals(model), silent = TRUE)
r <- try(as.numeric(stats::residuals(model)), silent = TRUE)

if (inherits(r, "try-error")) {
insight::format_alert(sprintf("Non-normality of residuals could not be computed. Cannot extract residuals from objects of class '%s'.", class(model)[1]))
Expand All @@ -174,16 +174,16 @@

if (inherits(model, "lm", which = TRUE) == 1) {
cook_levels <- round(stats::qf(0.5, s$fstatistic[2], s$fstatistic[3]), 2)
} else if (!is.null(threshold)) {
cook_levels <- threshold
} else {
} else if (is.null(threshold)) {
cook_levels <- c(0.5, 1)
} else {
cook_levels <- threshold
}

n_params <- tryCatch(model$rank, error = function(e) insight::n_parameters(model))

infl <- stats::influence(model, do.coef = FALSE)
resid <- insight::get_residuals(model)
resid <- as.numeric(insight::get_residuals(model))

std_resid <- tryCatch(stats::rstandard(model, infl), error = function(e) resid)

Expand Down Expand Up @@ -212,8 +212,8 @@
ncv <- tryCatch(
{
data.frame(
x = stats::fitted(model),
y = stats::residuals(model)
x = as.numeric(stats::fitted(model)),
y = as.numeric(stats::residuals(model))
)
},
error = function(e) {
Expand Down

0 comments on commit b26b139

Please sign in to comment.