# Validation of a linear mixed effect Model

I am setting up models of the diversity data (Shannon Index) of bees and hoverflies to find out which in which studied seed mixture (site) the diversity was higher. In addition, I would like to know if this was influenced by the diversity of the plant species or by the flower cover of these. I added the site and the field visits (3 times) as a random effect, because they were chosen randomly and I do not expect a direct effect on the diversity, or this is not of interest.

Since I am not very familiar with model validation and there is no clear explanation online how to interpret the results of a test for overdispersion or zero inflation, I would like to pray for help.

What I have done so far:

my models basically look like this:

lmer(H_bee ~ seedmixture + H_plant + blueh_deck + (1|location) + (1|fieldvisit), data = insect_plant, REML = FALSE).


Some Information: There are two seed mixtures (RH and WD), I have visited 4 locations and those ones in 3 different month (fieldvisit).

Results of the Model

summary(lmer_H_schweb)

Linear mixed model fit by maximum likelihood  ['lmerMod']
Formula: H_bee ~ seedmixture + H_plant + blueh_deck + (1 | location) +      (1 | fieldvisit)
Data: insect_plant

AIC      BIC   logLik deviance df.resid
-87.2    -64.3     50.6   -101.2      189

Scaled residuals:
Min      1Q  Median      3Q     Max
-1.3061 -0.4246 -0.1407  0.0503  5.9872

Random effects:
Groups     Name        Variance Std.Dev.
location   (Intercept) 0.002702 0.05198
fieldvisit (Intercept) 0.002588 0.05087
Residual               0.033112 0.18197
Number of obs: 196, groups:  location, 4; fieldvisit, 3

Fixed effects:
Estimate Std. Error t value
(Intercept)  0.073241   0.060921   1.202
seedmixtureWD   -0.043332   0.031068  -1.395
H_plant      0.034441   0.033140   1.039
blueh_deck  -0.005288   0.005611  -0.943

Correlation of Fixed Effects:
(Intr) StgtWD H_plnt
SaatgutWD  -0.544
H_plant    -0.582  0.341
blueh_deck -0.398  0.433  0.012



I used the DHARMa Package to test for zero-inflation and also overdispersion. The overdispersion Graph looks quite good to me, but the zero-inflation is a bit confusing...

I also used the plot() function with the simulationOutput. Thats the point where I thought that the models are not well. First of all there is the note "Quantile deviations detected" and further more the QQ plot has that big step at the end to another bunch of Datapoints in the plot. Also the red line is not fitting the black points, as I know it from other models.

QQ Plot

Overdispersion test

Zero inflation test

I would be so thankful to get some advice, whether this model is reliable, or how I could get the problem under control. If it were a Poisson distribution, I would switch to a negative binomial distribution. However, I have not found a solution for this in the lmer models.

• Could you please add the results of summary(model) to your question, as text (e.g. in a code block), and delete the image of the fixed-effect table? Images are bad because they're unsearchable and inaccessible to people using screen readers ... Sep 23 at 23:35
• Thank you for the fast feedback. I am new here and did not know how to add code properly in the question, but have added the summary of the model now. Sep 24 at 7:46

You should try to figure out which observations these are and what's going on with them. If you plot(fitted_model, id = 0.05) you'll get a residuals-vs-fitted plot with some outliers (see ?lme4::plot.merMod for details) identified by row number.
For what it's worth, it may not work very well to treat site and field as random effects if they each only have three levels. (It would help to have summary(fitted_model) included in the text of your question [as cut-and-pasted text, not as a screenshot image].)
• Nevertheless, I would worry about the outliers - not so much because I think they will invalidate the model as that you should understand what's going on in your data. You should be able to use the influence() function from the car package to understand what effect these observations are having on your conclusions (or, more crudely, refit the model with those observations excluded and see what happens) Sep 25 at 22:56