# Random intercept mixed model in R - is this fit… OK?

I am looking for opinions/interpretation on a model I'm trying to fit. A disclaimer: I'm an ecologist and not a statistician; and I appreciate everyone's time and opinions! I am generally following Zuur et al. 2009's (using R) recommendations in an attempt to model travel speed as a function of a few environmental covariates, the main one of interest being a 1/0 "treatment" variable.

The data are by nature are hierarchical and I have therefore used a mixed model with a random intercept. The mixed model fits significantly better than the base gls model. Additionally I included a varIdent with the mixed model, and that is significantly better than without.

From this point, I have looked at assumptions and diagnostics - the residuals look OK, I think, but I always have a hard time telling if it's "too much" pattern. I think less than 5% of the data are outside of the 2/-2, so I'm good there. The variation doesn't seem to be driven by any points in particular, and the variance of residuals for each group of the "treatment" is close to 1 (using tapply; I interpret this as minor heterogeneity). A box plot of the residuals by the random effect shows equal spread around zero and minor variation = independence (see below)?

I've looked at residuals vs. fitted (not too bad), residuals vs. each covariate (pattern with one of my covariates, elevation), histogram of the residuals (still quite skewed), and have checked for all potential influential observations.

I just don't know if I'm "done" and can now consider this model an OK fit?

I've included a couple of diagnostic images (response variable can't go below a certain value, and therefore the residual plot shows a sharp "line" in the negative values) - std residuals vs fitted; residuals by random intercept; histogram of residuals (not normalized); residuals by elevation covariate - could be something going on here, but not sure how to deal with it:

• You don't say much about the nature of your data. Have you considered a transformation of the dependent or using a glmm? The plots seem to indicate that it might be appropriate and "response variable can't go below a certain value" also hints at that. – Roland Aug 27 '13 at 12:38
• Yep, I've considered that as a last resort (because it doubly complicates interpretation). The Y data are continuous (speed), but there are upper and lower thresholds (an animal can only travel so fast or slow). There are many small values of Y and few large values. I had considered a glmm with gamma family, but if I want to do that in R, I'm looking at MCMC and then I'm afraid I'm a bit too far out of my league. – RLang Aug 27 '13 at 14:25
• I don't think you need to be afraid of MCMC. There is a nice vignette for MCMCglmm. – Roland Aug 27 '13 at 14:37
• ha, thanks!! i'll take a deep breath and have a look :) appreciate your comments too! – RLang Aug 27 '13 at 18:13
• I don't know if any of the models in cran.r-project.org/package=MCMCpack would be useful. It's a nice package. I'm not an expert, but both of your residual plots do appear to indicate issues with your fit. – Wayne Aug 28 '13 at 21:45

From the residuals vs fitted values plot it seems that your data are bounded (this also seems to be stated in the question comments. Thus a gamma GLMM would be a good choice and there are lots of packages that can fit such models apart from MCMCglmm