Skip to content
Prev 12669 / 20628 Next

Formula Explanation in lme4 Vignette

Hello,

In the software article vignette, it says that

resp ~ FEexpr + (REexpr1|factor1)

is the general format of mixed models. However, there's a sleep study example which has

fm1 <- lmer(Reaction ~ Days + (Days | Subject), sleepstudy)

When I look at those two formulae, I see that Days matches both FEexpr and REexpr1. I thought that a factor could be a fixed effect or random effect, but not both. In lectures, I remember fixed and random effects as being exclusive, depending on if all the levels were measured, or just a subset of them.

--------------------------------------
Dario Strbenac
PhD Student
University of Sydney
Camperdown NSW 2050
Australia