I am conducting a GLMM with a random slope effect and would like to know if this random slope effect is significant or no. To do this, i did two things,
First, compare the full model with the random slope with reduced models using likelihood ratio test. The reduced model includes a model excluded the random effect and a model include a random intercept.
Here is my code:
m1<-glmmTMB(fitness~Year+Plant*type+(1|Site.M)+(1|Site.F)+(type|Tree.ID),
weights=No.OV, family=binomial,data=OV.sum1)
m2<-glmmTMB(fitness~Year+Plant*type+(1|Site.M)+(1|Site.F),
weights=No.OV, family=binomial,data=OV.sum1)
m3<-glmmTMB(fitness~Year+Plant*type+(1|Site.M)+(1|Site.F)+(1|Tree.ID),
weights=No.OV, family=binomial,data=OV.sum1)
anova(m2,m3,m1)
Second, I also calculated the marginal and conditional variance for each model using function "tab_model"
The anova result is that model 1 is significantly better than model 2 and 3.
Df AIC BIC logLik deviance Chisq Chi Df Pr(>Chisq)
m2 6643.3 6676.8 -3312.7 6625.3
m3 4786.4 4823.6 -2383.2 4766.4 1858.89 1 < 2.2e-16 ***
m1 4350.9 4406.7 -2160.5 4320.9 445.53 5 < 2.2e-16 ***
However, for the conditional variance explained by the model, model 3 has the highest conditional variance:
Marginal R2 Conditonal R2
model 3: 0.053 0.279
model 1: 0.045 0.251
I couldn't understand this and wondering if model 1 with a random slope is still the best model. Could anyone help with this?