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

Diagonal residual line when using glmmTMB #78

Closed
fabiocarrella opened this issue Jul 17, 2018 · 1 comment
Closed

Diagonal residual line when using glmmTMB #78

fabiocarrella opened this issue Jul 17, 2018 · 1 comment

Comments

@fabiocarrella
Copy link

fabiocarrella commented Jul 17, 2018

Hi,

I'm currently working on a model that, unfortunately, I can't reproduce. I have a count type dependent variable, several count type independent variables, and thousands of observations taken from three subjects.
The model I'm trying to fit is structured in the following way: model.1<-glmmTMB(dep.var. ~ ind.var1 + ind.var2 + ind.var3 + (1|Subjects/Observations), family = "nbinom2").
When I try to observe the residual plot with Dharma, this is the result:
rplot
As it can be seen, there is a rather perfectly diagonal line in the graph on the right that I can't explain. When I fit the same formula with glmer.nb, I receive a totally different output (not diagonal, but not acceptable either). I have read issues #16 and #43 as I suppose they are related to this one. I have also thought that overdispersion may be the cause, but it should be accounted by the negative binomial family. Unfortunately, my inexperience in this field is stopping me from understanding many of the solutions proposed.

@florianhartig
Copy link
Owner

Hi @thomyorke7 ,

sorry for the late reply - as you have realized, this could be created by #16 and #43 (actually, I find that likely), but it could also be another problem.

If you want to be sure, you could calculate unconditional model predictions by hand (by calculating exp [ sum(fitted values * predictors ] )) and plot the residuals vs. fitted plot by hand. If the pattern disappears, it was caused by the random effects.

I have asked the developers of glmmTMB to provide unconditional predictions, so that I hope that this problem can soon be solved.

Best,
F

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

No branches or pull requests

2 participants