Skip to content
Prev 6572 / 20628 Next

lmer model specification

Dear Gustavo,

1) id:sex makes only sense if for a given id, multiple levels of sex are possible. So an individual can be male at one occasion and female at the next occasion. That's probably not what you want.

I would rather add a temperature:sex interaction to the fixed effects.
lmer(y ~ f1 + f2 + f3 + temp*sex + (temp|id), data)

Fitting the sexes seperatly is not needed.

2) I would recode the data and add a couple ID (assuming each person in only part of one couple in your dataset).
lmer(y ~ f1 + f2 + f3 + temp * sex + (temp|couple) + (1|ID),  data)

The couple random intercept and slope takes care of the within couple correlation. The ID random effect takes care of variability within the couple.

Best regards,

Thierry