performance icon indicating copy to clipboard operation
performance copied to clipboard

Unnecessary checks in `check_model` for NB models

Open mattansb opened this issue 2 years ago • 3 comments

Dispersion plot does not seem to account for the theta parameter in the model?

library(performance)

set.seed(3)
mu <- rpois(500, lambda = 3)
x <- rnorm(500, mu, mu*3) |> ceiling() |> pmax(0)

quine.nb1 <- MASS::glm.nb(x ~ mu)


check_model(quine.nb1)

Created on 2022-10-23 by the reprex package (v2.0.1)

mattansb avatar Oct 23 '22 11:10 mattansb

@bwiernik ?

strengejacke avatar Oct 23 '22 11:10 strengejacke

Not sure, do you still think the plot is inaccurate? The results from simulate_residuals() (DHARMa) look in line with the plot?

library(performance)

set.seed(3)
mu <- rpois(500, lambda = 3)
x <- rnorm(500, mu, mu * 3) |>
  ceiling() |>
  pmax(0)
m <- MASS::glm.nb(x ~ mu)

check_overdispersion(simulate_residuals(m))
#> # Overdispersion test
#> 
#>  dispersion ratio =   0.410
#>           p-value = < 0.001
#> Underdispersion detected.

check_model(m)

Created on 2024-03-17 with reprex v2.1.0

strengejacke avatar Mar 17 '24 09:03 strengejacke

(edit: sorry, wrong reprex, did not reinstall the pkg)

strengejacke avatar Mar 17 '24 12:03 strengejacke