check_overdispersion() seems to just be returning the same results for poisson and quasipoisson. I think the latter should be based on simulated residuals, but that's not enabled yet so maybe that's why?
fit <- glm(
formula = DriversKilled ~ PetrolPrice,
family = poisson(link = "log"),
data = Seatbelts
)
check_overdispersion(fit)
#> # Overdispersion test
#>
#> dispersion ratio = 4.470
#> Pearson's Chi-Squared = 849.362
#> p-value = < 0.001
#> Overdispersion detected.
simulate_residuals(fit)
#> Simulated residuals from a model of class `glm` based on 250
#> simulations. Use `check_residuals()` to check uniformity of residuals or
#> `residuals()` to extract simulated residuals. It is recommended to refer
#> to `?DHARMa::simulateResiudals` and `vignette("DHARMa")` for more
#> information about different settings in particular situations or for
#> particular models.
Quasi-poisson - incorrect?
fit2 <- glm(
formula = DriversKilled ~ PetrolPrice,
family = quasipoisson(link = "log"),
data = Seatbelts
)
check_overdispersion(fit2)
#> # Overdispersion test
#>
#> dispersion ratio = 4.470
#> Pearson's Chi-Squared = 849.362
#> p-value = < 0.001
#> Overdispersion detected.
simulate_residuals(fit2)
#> Error in simulate.lm(object, nsim = nsim, ...): family 'quasipoisson' not implemented
check_overdispersion()
seems to just be returning the same results for poisson and quasipoisson. I think the latter should be based on simulated residuals, but that's not enabled yet so maybe that's why?Poisson - correct
Quasi-poisson - incorrect?
Created on 2024-06-13 with reprex v2.1.0