florianhartig / DHARMa

Diagnostics for HierArchical Regession Models
http://florianhartig.github.io/DHARMa/
205 stars 22 forks source link

Residuals vs. Predicted (interpretation) #435

Open MatildeCorreia17 opened 6 days ago

MatildeCorreia17 commented 6 days ago

Hi, I have a dataset with 25612 observations and I modeled the utilization area against some biological traits, with a glmmTMB using family= gamma(link="log"). When I was analyzing the residuals with DHARMa package, I obtained the following plots:

Captura de ecrã 2024-09-20, às 16 45 11 Captura de ecrã 2024-09-20, às 15 55 20

I get that my model is not of a good fit, but I would like to understand better the interpretation of the residuals vs. predicted (what are the red lines, the black points and the grey shading)

melina-leite commented 3 days ago

Hi @MatildeCorreia17, the plot on the right side is produced by the plotResiduals function. The help page of the function can help you interpret the results:

You probably have heteroscedasticity in your data, i.e. the dispersion changes with the predicted mean (indicated by the non-straight line for the spline and the white triangle area in the bottom left of the plot). You could address it with the dispersion argument in glmmTMB.

Or it could be also the case that the Gamma distribution (with the link function you are using) is not the best distribution for your data.

Best, Melina