# Model individual differences by id or by numerical variables?

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

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.
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.$$^{}$$ 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.
$$$$: McCulloch, Charles E., S. R. Searle, and John M. Neuhaus. Generalized, linear, and mixed models. Hoboken, New Jersey: John Wiley & Sons, 2008.