I came across the following issue recently. I hope someone will be able to help me understand.
Say that I want to study the effect of a categorical variable X on my outcome y. X is a factor, and I use dummy coding with one level of X (say, x0) as a reference. It is a repeated measure design, where each subject is tested for all levels of the factor X. To proceed with the analysis, I fit a mixed-effect model with random intercept (grouped by subject-ID) using Maximum Likelihood estimation. Hence, the intercept will correspond to the level x0, and the fitting algorithm will estimate a specific intercept for each subject (in addition to the fixed effect of course).
There can be missing data. In particular, let's assume that for some subjects, the outcome y corresponding to the level x0 (ie reference level of X) is missing. How can the algorithm estimate the subject-specific intercepts for the missing values? If there is only one missing value, then the problem should be feasible: since random effects are assumed to be normally distributed, then their sum should be equal to zero, and this constraint helps finding unambiguous estimates. What happen if there is more than one missing value (associated to the level x0)? Doesn't the problem become ill-posed and have multiple solutions? The function lme seems to be able to deal with this (I can fit the model with no warnings and no errors), but how reliable will this model be?
Thanks a lot for your help!