# Selecting random effect in random effect model

I'm working on a project regarding the effect of water sources on the number of species inhabiting 3 mountains. Species were surveyed in 5 plots for each mountain and data were organised as follows: a table reporting the number of species (columns) in each plot (rows), and a table containing information about each plot including the number of water sources available. I was trying to estimate the effect of the presence of water (normalized number of sources available) on the number of individuals of each species found in each plot. Given the structure of my data, I was thinking to fit multiple mixed effect models using the glmmADMB package in R. The probability distribution that best fits my data, based on the Akaike information criterion, is the negative binomial distribution which is supported in glmmADMB. Would it be correct to consider the mountains and the plots as nested random effects (i.e. 1|plot/mountain) or it's better to include plots only (i.e. 1|plot)?

• The code 1|plot/mountain indicates you have mountains nested in plots. Your study description makes it sound like plots are nested in mountains, which would be 1|mountain/plot. – aosmith Jun 13 '17 at 20:16

I am not familiar with the package, but is it possible to fit a model with the random intercepts for plot and mountain and then fit a model with only the random intercept for plot, and then compare the two models? So:

mod0 <- ... (1|plot)
mod1 <- ... (1|plot/mountain)
anova(mod0,mod1)


That would tell you from the data whether or not there is significant variance around the random intercept for mountain.

Again, I'm not familiar with the package, so I apologize if this is not possible, but that is how I would address the question using the lme4 package.

• Tanks Mark for the reply. Actually, I did what you are saying but I have to do more than 1000 models and I would like to rely on the data more than on a p-value. If I try to compare the two models programmatically I don't get always the same result; sometimes the first model seems the best one but sometimes it seems not so I would rather make a decision based on the experimental design. Do you think that an environmental factor (such as mountains) could be used as random effect? – Giovanni Apr 26 '17 at 10:41
• I'm curious: Why do you have more than 1000 models? Also, I was just involved in a conversation on here about when to use a variable as a cluster: stats.stackexchange.com/questions/275450/… – Mark White Apr 26 '17 at 14:29
• I was planning to model each species separately and then adjust p values using false discovery rate. Since I have more than 1000 different species, I'm planning to do more than 1000 models... does it seem reasonable to you? I read your conversation and I think that the observations (species) in each environment (mountains) cannot be considered as totally independent (different species may interact with each other in the same environment), so I think that a nested models could make sense here but I'm still not as sure about this. – Giovanni Apr 27 '17 at 10:05
• The three-level (1|plot/mountain) sounds like what I would do. Instead of doing 1,000 different models for 1,000 different species, you could also model all species at once and use species as a crossed random effect: (1|species) + (1|plot/mountain). Check out the Penicillin data here: lme4.r-forge.r-project.org/book/Ch2.pdf – Mark White Apr 27 '17 at 15:06
• Thanks again Mark for the suggestion. I wouldn't do the "crossed effect" trick cause I have some counts that are zero-inflated and some other that are not, so I was thinking about the 1000 models strategy checking for zero-inflation each time. – Giovanni Apr 27 '17 at 15:47