Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem with binned residuals with version 0.10.7 #646

Closed
richardjtelford opened this issue Oct 29, 2023 · 0 comments · Fixed by #645
Closed

problem with binned residuals with version 0.10.7 #646

richardjtelford opened this issue Oct 29, 2023 · 0 comments · Fixed by #645

Comments

@richardjtelford
Copy link

performance::check_model works with 0.10.5

packageVersion("performance")
#> [1] '0.10.5'
tot <- rep(10, 100)
suc <- rbinom(100, prob = 0.9, size = tot)

df <- data.frame(tot, suc)
df$prop <- suc/tot

mod1 <- glm(prop ~ 1 ,
            family = binomial,
            data = df,
            weights = tot)

performance::check_model(mod1)

Created on 2023-10-29 with reprex v2.0.2

but fails with 0.10.7

packageVersion("performance")
#> [1] '0.10.7'
tot <- rep(10, 100)
suc <- rbinom(100, prob = 0.9, size = tot)

df <- data.frame(tot, suc)
df$prop <- suc/tot

mod1 <- glm(prop ~ 1 ,
            family = binomial,
            data = df,
            weights = tot)

performance::check_model(mod1)
#> Error: `check_model()` not implemented for models of class `glm` yet.

Created on 2023-10-29 with reprex v2.0.2

The problem seems to come from the new version.

With debug(performance:::.check_assumptions.glm), I find

binned_residuals(model, ...)
Error in stats::binom.test(sum(y0[items]), n) : 
  'n' must be a positive integer >= 'x'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant