I conducted a full 3x2x2 (W1
,W2
,W3
) within design with every participant experiencing the same 12 conditions. Within each condition, there were several measurements of my outcome variable(outcome
). Additionally, I want to include a covariate (covariate
) in my model that was measured as on the same level as my outcome, i.e. several times within each condition.
I set up the model using nlme
(following Field, Miles, & Field, 2012; chapter 13):
Model_lme <-lme(outcome ~ W1 + W2 + W3 + W1:W2 + W1:W3 + W2:W3 + W1:W2:W3 + covariate ,
random = ~covariate|Subject/W1/W2/W3, data = data,control = list(opt = "optim"), method = "ML")
And using lme4
Model_lme4 <- lmer(outcome ~ W1*W2*W3 + covariate + (1 + covariate|Subject/W1:W2:W3),
data=data, REML=FALSE)
I would be very grateful if someone could answer the following questions:
1) Are these model really equivalent? I'm not sure about the Lme4
approach right now.
2) When comparing the models without the covariate
, I find a significant effect of W2
. After introducing the covariate
, this main effect is no longer present. Is it then fine to state that the main effect of W2
was explained by the significant covariate
?
3) Finally, I am also not sure how to report my model. As I understand, the models describe my data as follows: W1
, W2
, and W3
are nested within participants. These factors have random intercepts (meaning that there is an intercept for each condition within each participant), but no random slopes. The covariate
is a factor with random intercept and slope.
Is that the way how to describe in a paper? It rather seems like papers only state whether something was handled a fixed or random effect (e.g. Jainta, Blythe, Nikolova, Jones,& Liversedge, 2015, p. 121)
I know these are many questions, but currently I am still really puzzled about mixed models, even though I read and try to understand every literature I can get regarding this topic.
Thanks in advance for your answers!
(W1*W2*W3 + covariate | Subject)
random term. You can try but this is a lot of random effects to fit, and you might not have enough data to fit this reliably. So you can simplify, e.g.(W1 + W2 + W3 + covariate | Subject)
, or with||
. What you have is an even further simplification(1 + covariate | Subject) + (1 + covariate | Subject:W1:W2:W3)
. $\endgroup$(1|subject) + (1|a:subject) + (1|b:subject) + (1|c:subject) + (1|a:b:subject) + (1|a:c:subject) + (1|b:c:subject) + (1|a:b:c:subject)
... It's tricky to reproduce this kind of anova with lmer exactly, it might be easier to adopt the mixed model style of thinking ant put w1/w2/w3 to the left of the vertical bar. $\endgroup$