Within-subject centering of a repeatedly measured dichotomous variable in a multilevel model?

I'm currently working on a nested data set consisting of 100 subjects which answered several questions at home on five consecutive days (ecological momentary assessment). Among them, they were asked if they adhered to the study protocoll on each given day (no/ yes), leading to 0 (no) or 1 (yes) in the data for each of the five days. The continous outcome variable was also assessed on each day.

The reserach question is whether beeing adherent on a given day has an effect on the outcome. Now, to explore the effect of the adherence on the outcome variable, I built a nested multilevel model (days within subjects) predicting the outcome by some covariates, a random intercept (high ICC) and the variable coding for adherence (0 or 1).

Normally, I would proceed and disentangle within-subject variations (person mean centered) from between-subject variations (grand mean centering of the person means) for the adherence variable. However, it seems rather odd to me to center a dichotomous variable. On the other hand, I know that it is necessary in order to get a clear picture of the within-subject effect. When not centering, I could enter the 0/1 adherence variable as a factor. However, in this case, it would confound within- and between-subject variations (because subjects do not only differ as compared to themselves but also in their total amount of adherence in comparision to the group, the grand mean).

Do you have any advice on whether I should center the 0/1 variable? If yes, how would you center? If no, how would you proceed?

Dear Erik (and everybody else interested), I know it has been a year or so but I have a follow up question and I think you could maybe help me with that, too:

I now have decided to add the dichotomous predictor as centered on the person means. Just as you predicted, when the person mean is added to the model, I geht within-subject effects for both variants (person-mean centered and person mean vs. 0/1-factor and person mean). Both variants are yielding exactly the same results.

I now have also added an interaction of the person-mean centered variable with a grand-mean centered covariate (person means centered at the grand mean). So far so good. However, I just tried and refitted the model with the dichotomus factor (0/1-factor) instead of the person-mean centered predictor and the interaction term changes drastically.

Do you have any idea why?

In short, it looks something like this:

y = x (as a factor with 0 / 1) * z (grand mean centered person mean of z) + x (person mean of x)

y = x (centered on the person mean) * z (grand mean centered person mean of z) + x (person mean of x)

Both interactions are giving me different results.

Thank you very much in advance!

• What would make you center a continuous variable? Dec 24 '21 at 13:08
• Hi Frank, thanks for the follow-up question. There are several cases where centering is essentiell to understand the effects in longitudinal (repeated measures) data. In brief, I need to make sure that within- and between-person effects are separated. Otherwise, the effects would be an uninterpretable blend of these two sources. See the following book for more in-depth information: Raudenbush, S., & Bryk, A. (2002). Hierarchical linear models (2nd ed.). Thousand Oaks, CA: Sage. Dec 26 '21 at 10:56
• I'm trying to think of a situation where the model is well-specified, you have sufficient replicates at all levels, and you need to center to be able to get separate effects. Right now I can't think of one except for this: you have interactions and want to use primary parameters instead of forming contrasts of interest. Dec 26 '21 at 13:28
• Centering can help to understand interaction effects and their lower order effects, but also the effects of the intercept (in case it is of interest), and can reduce collinearity (at least mathematically). In longitudinal multilevel models, where subects have multiple observations (sometimes across several days or weeks), the fixed effects are not interpretable if the effects are not seperated into between- and within-subject variances (e.g., by person-mean centering and grand-mean centering of person-means). In classical regression models, centering is not that important (in my opinion). Dec 27 '21 at 16:34