First of all, I am a beginner in statistics, and I have been reading some questions and comments here regarding this matter but I am still a bit lost.
My problem:
I am constructing GLMM's in order to assess habitat selection. For now I am doing some exploratory analysis to each one of my variables. I am checking AIC (and AICc, which has been the same for AIC) and R squared (both using MuMIn
R
package), and overdispersion, using RVAideMemoire
R
package. I am a beginner in statistics, and I have been reading some questions and comments here regarding this matter but I am still a bit lost.
Regaring the dataset:
X is the dependent variable, it is binomial (1 and 0); 1 represents "used" locations, obtained through telemetry techniques, and 0 represents "available", which are random points collected across each study area. Variable A represents study areas and Variable B represents interactions between individuals (represented in codes, for instance: M01-M02; M01-M02-F01, and so on), and each group of individuals is unique for each study area. Variable 1 represents a given type of land cover.
str(data1)
'data.frame': 32670 obs. of 8 variables:
$ VarA: Factor w/ 5 levels
$ VarB: Factor w/ 51 levels
$ X : int 1 1 1 1 1 1 1 1 1 1 ...
$ Var1 : num -0.201 -0.201 -0.201 -0.201 -0.201 ...
$ Var2 : num 1.383 -0.973 -0.748 1.611 -0.973 ...
$ Var3 : num -0.0985 -0.0985 -0.0985 -0.0985 -0.0985 ...
$ Var4 : num -0.482 -0.482 0.942 -0.482 -0.482 ...
$ Var5 : num -0.502 0.293 0.813 -0.783 2.41 ...
For each variable, I am constructing a GLMM using two different random effects, because I don't know which one is best/most appropriate for my data. For instance, I have these models for the same variable:
lm1 <- glmer(x~Var1+(1|VarA), data=data1, family = binomial(link="logit"))
lm1_1 <- glmer(x~Var1+(1|VarA/VarB), data=data1, family = binomial(link="logit"))
lm1_2 <- glmer(x~Var1+(1|VarA)+(1|VarA/VarB), data=data1, family = binomial(link="logit"))
For each model, I check AIC, R squared and overdispersion, and I don't know how to interpretate my results. For instance:
lm1: AIC-19908.9; overdispersion-0.609;r2m and r2c almost zero (4.06e-07)
lm1_1: AIC-8806.5; overdispersion-0.261;r2m-0.0016 and r2c-0.7923
For lm1_2 I get:
Warning message:
In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, :
Model failed to converge with max|grad| = 0.00174688 (tol = 0.001, component 1)
ANOVA for lm1 and lm1_1:
> anova(lm1, lm1_1)
Data: data1
Models:
lm1: Used ~ Var1 + (1 | VarA)
lm1_1: Used ~ Var1 + (1 | VarA/VarB)
Df AIC BIC logLik deviance Chisq Chi Df Pr(>Chisq)
lm1 3 19908.9 19934.1 -9951.4 19902.9
lm1_1 4 8806.5 8840.1 -4399.3 8798.5 11104 1 < 2.2e-16 ***
This pattern repeats itself across other variables.
1) How do I interpret this? Because, if I focus only on AIC, lm1 is the most appropriate, and also if I consider overdispersion. But R2 is terrible. If I focus on R2, it is only good for lm1_1 and only for the nested random effect, which would indicate that the nested random effect is "correct". Am I right?
2) Are there any other good approaches for GLMM?
VarA
andVarB
? Normally the physical/biological situation would dictate whether or not to include higher levels of grouping. Trying to select a model based on a combination of AIC and psuedo $R^2$ is often futile as they are both difficult to apply to GLMMs and they are assessing different things. Also, note that(1|VarA/VarB)
is equivalent to ` (1 | VarA)+(1 | VarA:VarB) ` which will fit a random intercept for bothVarA
andVarB
withVarB
withinVarA
so the(1|VarA)
in your formula for lm1_1 is redundant. $\endgroup$ – Robert Long Jul 3 '16 at 13:44str()
of the data. $\endgroup$ – Robert Long Jul 3 '16 at 14:52Var2
-Var5
not in the model ? Also, please post the output fromglmer()
forlm1
andlm1_1
along with the output fromanova(lm1,lm1_1)
$\endgroup$ – Robert Long Jul 3 '16 at 15:27