More About Model Selection
Learn how to decide which specific model to use.
Introduction
How do we know if we should include some random effects in our model? One way is by using AIC to compare two models that differ only because one has random effects and the other doesn’t. For example, we can build a linear model like lmm1
, but that model doesn’t have any random effects. We’ll use RxP.clean
to facilitate a comparison with the lmm1
model here:
lm6<-lm(log.Age.DPO~Res*Pred, data=RxP.clean)
Now, one important thing to know is that the lme4 package uses a technique to fit mixed-effects models called restricted maximum likelihood, or REML for short.
Regular linear models and generalized linear models are fitted with a standard maximum likelihood approach. We won’t get into the difference between them here, but just know that if we want to compare a linear model and a linear mixed-effects model, we have to fit the mixed model without using REML. That’s easy enough. We just need to specify the REML = F
argument in the model.
As a sidenote, you might have noticed a message earlier when we used anova()
to calculate likelihood ratio tests that stated “refitting model(s) with maximum likelihood (ML) (instead of REML
)”. This message says that to ...