Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REML = FALSE in lmm_f.R #2

Open
amael-ls opened this issue Feb 11, 2020 · 1 comment
Open

REML = FALSE in lmm_f.R #2

amael-ls opened this issue Feb 11, 2020 · 1 comment

Comments

@amael-ls
Copy link

amael-ls commented Feb 11, 2020

In the R code, it is written (line 109 -- 125):

M0<-lm(Z_TP~Z_Length,data=data)
# Modèle complet avec différents intercepts
M1<-lmer(Z_TP~Z_Length + (1|Fish_Species) + (1|Lake), data=data, REML=FALSE)
# Modèle complet avec différents intercepts et pentes
M2<-lmer(Z_TP~Z_Length + (1+Z_Length|Fish_Species) + (1+Z_Length|Lake), data=data, REML=FALSE)
# Aucun effet Lac, intercept aléatoire seulement
M3<-lmer(Z_TP~Z_Length + (1|Fish_Species), data=data, REML=FALSE)
# Aucun effet Espèce, intercept aléatoire seulement
M4<-lmer(Z_TP~Z_Length + (1|Lake), data=data, REML=FALSE)
# Aucun effet Lac, intercept et pente aléatoires
M5<-lmer(Z_TP~Z_Length + (1+Z_Length|Fish_Species), data=data, REML=FALSE)
# Aucun effet Espèce, intercept et pente aléatoires
M6<-lmer(Z_TP~Z_Length + (1+Z_Length|Lake), data=data, REML=FALSE)
# Modèle complet avec intercepts et pentes qui variant par Lac
M7<-lmer(Z_TP~Z_Length + (1|Fish_Species) + (1+Z_Length|Lake), data=data, REML=FALSE)
# Modèle complet avec intercepts et pentes qui variant par Espèce
M8<-lmer(Z_TP~Z_Length + (1+Z_Length|Fish_Species) + (1|Lake), data=data, REML=FALSE)

Given only the random effect structure is changing, while the fixed structure remains the same, I think REML = TRUE should be used instead, especially if the aim is to select a random structure using $AIC_c$ (cf section 5.7, p120-122, Zuur 2009, Mixed effects models and extensions in ecology with R).

@KevCaz
Copy link
Member

KevCaz commented Mar 2, 2020

Hi @amael-ls, this code aims at comparing M1, M2, ..., M8 to M0. There is no comparison between models with different random effects (that is my understanding). If I am correct, then it looks like it is ok, isn't it? There is a comparison between 2 models with 2 different structure made latter on in the workshop and REML=TRUE is properly used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants