Reputation: 209
I have a model like this:
fm<-lmer(V4 ~ V2 * V3 + (1 | V1), data = data)
I want to obtain the full parameterization of it, with random intercept and randon slope. I can use this model?
fm<-lmer(V4 ~ V2 * V3 + (1 + V2 + V3 | V1), data = data)
Upvotes: 0
Views: 34
Reputation: 50678
The most general model with group-wise (i.e. random) intercepts and slopes for V2
and V3
would be
lmer(V4 ~ V2 * V3 + (V2 * V3 | V1), data = data)
Taking into account that V2 * V3
is short for V2 + V3 + V2:V3
we can identify the following terms:
1 +
)V2
V3
V2
and V3
V1
(from the implicit (1 + ... | V1)
V2
for every level of V1
V3
for every level of V1
V2
-V3
interaction for every level of V1
The Cross Validated post R's lmer
cheat sheet is a great resource for understanding the individual terms, and how to successively build the most general model.
Upvotes: 1