I want to understand the effect of IV on my DVs (each subject has multiple measurements). I realize that my default analysis approach is to use the subject id as the random variable and throw the IVs and DVs into the mixed-effects models. I think my default and simple approach makes total sense since my goal is to understand the effect of IV instead of other variables.

However, I am wondering when should we use the alternative approach, which is to quantitatively model individual differences by subjects' key characteristics (e.g., numerical variables like age, or categorical variables like gender). In addition, if we want to do that, do we still need to use mixed-effects models?

My default approach: DV ~ IV + (1|subject ID)

The alternative approach: DV ~ IV + subject's age + subject's gender

Any recommendations of textbooks/blogs about this topic are welcome! I need more systematic education about mixed-effects models.

Thank you so much!


1 Answer 1


If a subject is represented in the data by multiple measurements, the independence assumption of linear regression does not hold and the resulting standard errors and $p$-values are misleading. A mixed model with a random intercept for subject ID takes this dependency into account, allowing for valid inference of nested/structured/hierarchical data.

The two approaches listed here aren't alternatives to one another. The mixed model you show first estimates a random intercept for subjects, meaning that individuals that start higher will also end up higher and vice versa. If you believe age and gender may confound the effect of the independent variable, you can still add their fixed effects to the model. This is a completely separate issue from the repeated measures.

For literature, you could have a look at these related threads: 1, 2. It's not exactly light reading, but personally I find McCulloch's Generalized, Linear, and Mixed Models to be a very thorough introduction.$^{[1]}$ This is also the book used for the master education in statistics at Leiden University. If you're not that comfortable with all the math involved and you just want a very global overview, you could have a look at my video lecture on mixed models.

$[1]$: McCulloch, Charles E., S. R. Searle, and John M. Neuhaus. Generalized, linear, and mixed models. Hoboken, New Jersey: John Wiley & Sons, 2008.


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.