2

I was wondering if it will violate any assumptions of linear mixed effects (LME) models if I were to include interaction terms between the covariates and IVs in my model.

For example, the model that I would like to specify would be:

model 1: lmer(DV ~ A / (B*C) + cov1 + cov2 + cov3 + cov4 + 
B:cov1 + B:cov2 + B:cov3 + B:cov4 + 
C:cov1 + C:cov2 + C:cov3 + C:cov4 + (1|ID), data=df)
  • Sorry my experience with LME is limited but I used '/' as a way of showing the estimates within the levels of the A factor, but essentially it performs the same function as using * – Wei Ting Chua Mar 13 '23 at 03:17

1 Answers1

2

The (1|ID) term in your model specifies random intercepts among the ID values. The intercept, with default R coding, is the estimate of the outcome when all fixed categorical predictors are at reference levels and all fixed continuous predictors have values of 0. So there's no problem with having the fixed predictors involved in interactions with each other; those random intercepts still make sense in terms of variation about the overall model intercept.

A potential problem is that your model omits individual coefficients for B and C and a B:C interaction. The term A/(B*C) is not the same as A*B*C:

attr(terms(formula(~A/(B*C))),"term.labels")
# [1] "A"     "A:B"   "A:C"   "A:B:C"  
attr(terms(formula(~A*B*C)),"term.labels")
#[1] "A"     "B"     "C"     "A:B"   "A:C"   "B:C"   "A:B:C"

In general, it's poor practice to omit lower-level coefficients of terms involved in higher-level interactions. As discussed on the linked page, there are some simple situations where you might get away with that, but with the three-way A:B:C interaction I suspect that you will be better off including individual coefficients for B and C and for a B:C interaction.

EdM
  • 92,183
  • 10
  • 92
  • 267