I once read around here that with binary factors in mixed effects models (lmer specifically), one shouldn't specify both random and fixed effects. The person went on to note that some people wouldn't combine fixed and random even for three- and four-level factors. Unfortunately, I can't recall if the person referred to random intercepts and/or random slopes in particular--what's certain is this relates to the very concept of random effects.

Does it ring true? Please take this question as from a beginner. It might as well be that obviously having both random and fixed effects doesn't make sense for a binary factor because there's nothing to control there... So, I have tried setting random intercepts and a fixed effect for a binary factor, and indeed, the model doesn't converge--yet that's little testing.

Sincerely thank you for any tips

  • $\begingroup$ What exactly do you mean by including both random and fixed effects? Can you provide an example? Are you talking about lmer(y ~ factor + (1|factor), data)? This does not make sense whatever the number of levels. $\endgroup$ – amoeba Oct 14 '16 at 10:10
  • $\begingroup$ Right. I mean something that would make sense, so a full model that includes other random and fixed effects. Meanwhile, I have received a reply elsewhere that says the claim in question wouldn't be right, whatever the levels of the factor. So, both random and fixed could normally make sense, even for a binary factor. Would you think the same? $\endgroup$ – Pablo Bernabeu Oct 14 '16 at 13:19
  • $\begingroup$ I am not sure I understand your situation so I still suggest you provide a more explicit example. E.g. lmer(y ~ x + factor + (1|factor), data) would not make sense either. $\endgroup$ – amoeba Oct 14 '16 at 13:36
  • $\begingroup$ One example would be lmer(y ~ (1 | participant) + (1|factorA) + (1|participant:factorA) + (1| factorB) + (1| factorB : participant) + (1| factorC) + (1| factorC : participant) + factorD + factorD : factorC + factorE, data) where I've entering each effect as parsimoniously as possible. FactorE is the critical, binary one. Theoretically (convergence and significance aside), could it have random intercepts? I'm starting to think it perfectly could, based on the feedback I've been getting (I might have misunderstood the original comment I'm referring to :-/). Thank you so much. $\endgroup$ – Pablo Bernabeu Oct 14 '16 at 16:40
  • $\begingroup$ Still not sure what you mean, but I don't think it ever makes sense to have + factorE and + (1 | factorE) in the same model. Is that what you were considering? Doesn't matter how many levels this factor has. $\endgroup$ – amoeba Oct 14 '16 at 23:03

Convergence and significance allowing, binary factors and others with few levels can theoretically combine any random and fixed effects (though see comments).

Many thanks to @amoeba and to other contributors on ResearchGate.

  • $\begingroup$ I don't think it ever makes sense to have + factorE and + (1 | factorE) in the same model. Doesn't matter how many levels this factor has. $\endgroup$ – amoeba Oct 14 '16 at 23:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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