You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, thank you for bringing DHARMa to our work – it's been incredibly helpful!
I have encountered dispersion issues while fitting a GLMM using glmmTMB. Initially, I aimed to explore the relationship between prevalence (defined as infectedbird / totalbird) and explanatory variables. I started with the following code:
After running the dispersion test, I found an underdispersion issue instead:
testDispersion(modeltwo)
DHARMa nonparametric dispersion test via sd of residuals fitted vs. simulated
data: simulationOutput
dispersion = 0.23962, p-value = 0.44
I would appreciate any insights into addressing the underdispersion.
TIA,
Nimo
The text was updated successfully, but these errors were encountered:
I tried to correct the misfits by adding splines, then it seems that the predictors match the quartile lines. However the model is still underdispersion.
First, overdispersion may arise not only from "real" overdispersion in the data but also from model misspecification. Before moving to a different model, I'd suggest further investigations in your current binomial model. For example, have you checked for heteroscedasticity in your model predictors? Or could you suspect a zero inflation in the proportion of infected birds?
Second, discarding the easiest misspecification problems, I'd use a different dispersion test. For GLMMs, the default dispersion test in DHARMa may not be the most appropriate (See more detailed on the tests in the vignette of the package and the testDispersion and simulateResiduals help files.). You could use:
the nonparametric version of the Pearson residuals chisquared test, by simulating residuals with refit=T. Depending on your model and data amount it may cost a lot of time:
res <- simulateResiduals(fittedModel, refit=T)
testDispersion(res)
simulate residuals conditional on the Random Effects, which in glmmTMB is a bit tricky but with a recent alternative implemented (package version 1.1.10) it became possible:
glmmTMB::set_simcodes(fittedModel$obj, val = "fix")
res <- simulateResiduals(fittedModel)
testDispersion(res)
# this is equivalent of doing this in lme4 package:
res <- simulateResiduals(fittedModel, re.form=NULL)
Third, if your model is really overdispersed, I'd use a beta-binomial model as an alternative to your binomial model (https://peerj.com/articles/1114/).
I hope this helps you in your modeling.
let me know if you have further comments or questions
:)
Hi @florianhartig,
First of all, thank you for bringing DHARMa to our work – it's been incredibly helpful!
I have encountered dispersion issues while fitting a GLMM using glmmTMB. Initially, I aimed to explore the relationship between prevalence (defined as infectedbird / totalbird) and explanatory variables. I started with the following code:
However, an overdispersion issue was detected. To address this, I adjusted the model to a negative binomial GLMM:
After running the dispersion test, I found an underdispersion issue instead:
I would appreciate any insights into addressing the underdispersion.
TIA,
Nimo
The text was updated successfully, but these errors were encountered: