In multilevel data, categorical predictors should be centered:
Yaremych, H. E., Preacher, K. J., & Hedeker, D. (2021). Centering categorical predictors in multilevel models: Best practices and interpretation. Psychological Methods.
Marginal effects on categorical predictors (e.g., using dummy coding) typically hold values at "0" and "1" and take the difference in the marginal predictions. This breaks when centering by cluster. Instead, plan is to implement something like:
at = c("Low", "High")
for categorical predictors centered by cluster. Approach is to set the categorical predictors at the "0" and "1" values for each individual person. That is, set the "observed" value at 1, then center using the existing mean, then predict. Repeat setting the "observed" value at 1, then center, then predict. The figure below is an example of this.
In multilevel data, categorical predictors should be centered:
Yaremych, H. E., Preacher, K. J., & Hedeker, D. (2021). Centering categorical predictors in multilevel models: Best practices and interpretation. Psychological Methods.
Marginal effects on categorical predictors (e.g., using dummy coding) typically hold values at "0" and "1" and take the difference in the marginal predictions. This breaks when centering by cluster. Instead, plan is to implement something like:
at = c("Low", "High")
for categorical predictors centered by cluster. Approach is to set the categorical predictors at the "0" and "1" values for each individual person. That is, set the "observed" value at 1, then center using the existing mean, then predict. Repeat setting the "observed" value at 1, then center, then predict. The figure below is an example of this.