1
$\begingroup$

I tried finding similar cases and questions but failed and got even more confused because the answers seem to depend on when the questions were asked due to changes in the lme4 package. So I'm sorry if the answer to this question is obvious to some but I just can't wrap my head around it and would appreciate some insights:

Dependent variable: rating data

Independent variable: word_variant (type a vs. type b)

Repeated measures design in which every participant rates every word (fully randomized) and sees both types of a word variant (e.g., type a=shoes vs. type b=slippers).

We also got participants to state their level of education and 2 other between-subject variables. They are not meant as independent variables (fixed effects) but we want to see if they account for variance in the data.

Now I'm unsure where these between-subject control variables go in the model. Can I just include them as fixed effects even though they are not fixed effects in terms of an independent variable? Can I include them in the subject random effect structure even though they are between-subject variables?

Intuitively, I would put the between-subject control variables in the subject and item random slope and not use them as fixed effects:

summary(my_model_1 <- lmer(rating ~ word_variant + (1+word_variant*education| subject) + (1+word_variant*education| item), data))

Alternatively, I could include the between-subject control variables as fixed effects but not in the subject random effect structure:

summary(my_model_2 <- lmer(rating ~ word_variant*education (1+word_variant| subject) + (1+word_variant*education| item), data))

Any insights would be highly appreciated! I hope my question is clear enough. Let me know if more information is required!

Thank you!

$\endgroup$

1 Answer 1

1
$\begingroup$

Can I just include them as fixed effects even though they are not fixed effects in terms of an independent variable?

Yes, I don't know what you mean by "they are not fixed effects in terms of an independent variable". That's exactly what they seem to be.

Can I include them in the subject random effect structure even though they are between-subject variables?

You are referring to fitting them as random slopes - which means that each subject will get it's own slope for that variable. Provided that the variables also vary within the groups, then that is fine. Otherwise see here:
Visualizing the folly of fitting random slopes for variables that don't vary within groups

Alternatively, I could include the between-subject control variables as fixed effects but not in the subject random effect structure:

Sure, there is no need to fit random slopes unless you have good reasons for expecting those variables to vary within the groups, and even if it is justified theoretically, quite often the data does not support such a complex random structure (leading to problems of singular fit, or sometimes non-convergence)

$\endgroup$
1
  • $\begingroup$ Does this answer your question ? If so please consider marking it as the accepted answer, and if you haven't already please consider upvoting it. If not, please let us know why ? $\endgroup$ Jun 27, 2021 at 19:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.