I'll start by saying apologies for perhaps not wording things correctly, as stats is not my first language (lol). Please let me know if there is any other info I need to provide to make this easier to understand. My research question is looking at how different landscape metrics affect species richness. The species richness was captured using camera traps at 25 different sites. These sites are classified into different land use types, like recreation, natural, yard, etc. My response variable is richness, explanatory variables are Buffer and landscape metrics, and the random effect are the specific sites, where each camera is was located. There are 4 different size buffers around each camera in which I measured landscape data, each changing the landscape metric value.

I have two questions with all this:

  1. Here is my first model to include all the significant landscape metrics. My advisor and I determined them from creating a series of plots with best fit lines and confidence intervals between richness and each metric. This is the full model:
mod14 = glmer.nb(Richness ~ (0 + Buffer + Pland_Woody + Pland_Herbaceous + 
  Area_MN_Woody + Area_MN_Herbaceous + ED_Woody + PD_Woody + PD_Herbaceous + 
  LPI_Woody + LPI_Herbaceous)^2 + (1 | Site), data = dat_3)

#with site nested within classification
mod14.5 = glmer.nb(Richness ~ (0 + Buffer + Pland_Woody + Pland_Herbaceous + 
   Area_MN_Woody + Area_MN_Herbaceous + ED_Woody + PD_Woody + PD_Herbaceous + 
   LPI_Woody + LPI_Herbaceous)^2 + (Classification | Site), data = dat_3)


When I tried to run mod14.5 it didn't like it and gave me the error:

Error: number of observations (=104) < number of random effects (=130) for term (Classification | Site); 
the random-effects parameters are probably unidentifiable

How do I fix this? What's going on?

  1. After narrowing down significant metrics based on AIC values of the models and p-values, I created this model:
#models with Buffers only and significant values from mod16 that interacted with buffers only
mod17 = glmer.nb(Richness ~ (0 + Buffer + Area_MN_Woody + PD_Woody + 
  PD_Herbaceous + LPI_Woody)^2 + (1 | Site),  data = dat_3)


Meaning I looked at the data and used reason to figure that the landscape metric interactions are only important in relation to the Buffers. Landscape metrics in relation to each other without a Buffer is not capturing the true pattern, it's over generalizing.

However I do want to account for the interactions between the landscape metrics and the Buffers, so I created this model:

mod18 = glmer.nb(
  Richness ~ (0 + Buffer*Pland_Woody*Pland_Herbaceous + Buffer*Pland_Woody*Area_MN_Woody + 
Buffer*Pland_Woody*Area_MN_Herbaceous + Buffer*Pland_Woody*ED_Woody + 
Buffer*Pland_Woody*PD_Woody + Buffer*Pland_Woody*PD_Herbaceous + 
Buffer*Pland_Woody*LPI_Woody + Buffer*Pland_Woody*LPI_Herbaceous +
Buffer*Pland_Herbaceous*Area_MN_Woody + Buffer*Pland_Herbaceous*Area_MN_Herbaceous + 
Buffer*Pland_Herbaceous*ED_Woody + Buffer*Pland_Herbaceous*PD_Woody + 
Buffer*Pland_Herbaceous*PD_Herbaceous + Buffer*Pland_Herbaceous*LPI_Woody +
Buffer*Pland_Herbaceous*LPI_Herbaceous + Buffer*Area_MN_Woody*Area_MN_Herbaceous + Buffer*Area_MN_Woody*ED_Woody + 
Buffer*Area_MN_Woody*PD_Woody + Buffer*Area_MN_Woody*PD_Herbaceous + Buffer*Area_MN_Woody*LPI_Woody + 
Buffer*Area_MN_Woody*LPI_Herbaceous + Buffer*Area_MN_Herbaceous*ED_Woody +
Buffer*Area_MN_Herbaceous*PD_Woody + Buffer*Area_MN_Herbaceous*PD_Herbaceous +
Buffer*Area_MN_Herbaceous*LPI_Woody + Buffer*Area_MN_Herbaceous*LPI_Herbaceous + 
Buffer*ED_Woody*PD_Woody + Buffer*ED_Woody*PD_Herbaceous + 
Buffer*ED_Woody*LPI_Woody + Buffer*ED_Woody*LPI_Herbaceous + 
Buffer*PD_Woody*PD_Herbaceous + Buffer*PD_Woody*LPI_Woody + 
Buffer*PD_Woody*LPI_Herbaceous + Buffer*PD_Herbaceous*LPI_Woody +
Buffer*PD_Herbaceous*LPI_Herbaceous + 
Buffer*LPI_Woody*LPI_Herbaceous) + (1 | Site), data = dat_3)

No surprise, R was not a fan, and said:

Error in eval(mc, parent.frame(1L)) : 
  pwrssUpdate did not converge in (maxit) iterations

Perhaps I need an optimizer option?

Any help would be appreciated. Please let me know if I can provide anything else to help figure this model out.

Thank you!

  • $\begingroup$ There is a lot going here and it may be hard to get specific advice about the issue you're facing without the data. Why are you forcing the model to have no intercept? (Classification | Site) doesn't specify that sites are nested within classification. Have you successfully fitted a model without all the interaction terms? $\endgroup$
    – dipetkov
    Mar 29 at 18:57
  • $\begingroup$ Keep in mind that you have 104 observations. The models you are attempting to fit may be too complex for your data. $\endgroup$
    – dipetkov
    Mar 30 at 9:00

1 Answer 1


Regarding your first question, it looks like the issue is that you have more predictors than observations. When you have a categorical covariate (e.g., Site), each level is treated as a separate covariate. The literature has different suggestions as to how many observations you should have per covariate. The lowest recommendation I have seen is 5 observations per covariate. From what I can tell, your data have Site levels with no observations--suggesting too much model for the data.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.