I have two questions:
- Is it ok/when might it be ok to specify a mixed model with a random slope but no random intercept?
- How would one specify such a model in lme4/glmmTMB?
I am working on a dateset that contains 200 snakes that have been measured at six points in time.
I first built a model that included weight as the outcome and individual as a random intercept.
w1 <- glmmTMB(weight_t ~ (1 | scale_id), data = long, family = gaussian) summary(w1) Family: gaussian ( identity ) Formula: weight_t ~ (1 | scale_id) Data: long AIC BIC logLik deviance df.resid 20488.5 20503.5 -10241.3 20482.5 1090 Random effects: Conditional model: Groups Name Variance Std.Dev. scale_id (Intercept) 7.284e-02 0.2699 Residual 8.055e+06 2838.1679 Number of obs: 1093, groups: scale_id, 200 Dispersion estimate for gaussian family (sigma^2): 8.06e+06 Conditional model: Estimate Std. Error z value Pr(>|z|) (Intercept) 2649.32 85.85 30.86 <2e-16 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Above we can see that the variance attributable to individual is minimal, it approximates zero. My interpretation of this is that the model is essentially equivalent with or without the random intercept for individual.
I then built a model with a correlated random slope for time and random intercept for individual.
w2 <- glmmTMB(weight_t ~ (t_days | scale_id), data = long, family = gaussian) Warning message: In fitTMB(TMBStruc) : Model convergence problem; non-positive-definite Hessian matrix. See vignette('troubleshooting') My interpretation here from reading the glmmTMB troubleshooting page is that this second model is too complex/overparameterized. This error can also occur when random effects approximate zero, but the first model ran so I assume this is not the case.
A model with uncorrelated random slope for time and random intercept for individual works. This model shows that the random slope for time is important but again suggests that the random intercept for individual is of little importance.
w3 <- glmmTMB(weight_t ~ (t_days || scale_id), data = long, family = gaussian) summary(w3) Family: gaussian ( identity ) Formula: weight_t ~ (t_days || scale_id) Data: long AIC BIC logLik deviance df.resid 18652.2 18672.2 -9322.1 18644.2 1089 Random effects: Conditional model: Groups Name Variance Std.Dev. scale_id (Intercept) 7.313e-02 0.2704 scale_id.1 t_days 3.523e+02 18.7697 Residual 6.472e+05 804.4942 Number of obs: 1093, groups: scale_id, 200 Dispersion estimate for gaussian family (sigma^2): 6.47e+05 Conditional model: Estimate Std. Error z value Pr(>|z|) (Intercept) -394.44 41.13 -9.589 <2e-16 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 The fact that this model ran, again brings be back to my conclusion that my correlated random slope and intercept model is too complex.
In conclusion it seems that a random slope for time is important but a random intercept for individual is not. Therefore, it would seem reasonable to include a random slope for time without a fixed intercept? Is this appropriate, if so how would I specify this?
I note that there seems to be at least two other conflicting posts on this topic. This post suggests it is ok to have a random slope but no random intercept, but the comments on this post suggest that you should not have a random slope without a random intercept.