A researcher collected some data of a response/outcome variable Y from, for example, 20 subjects. In addition to an explanatory (within-subject or repeated-measures) variable A (a factor with two levels, A1 and A2), he would also want to consider another explanatory (and continuous) variable X. He's interested in finding out the effect of factor A on Y, and in the meantime would like to control for the variability in Y due to X. However, the subtle issue here is that X is correlated with Y to some extent, and, more importantly, the two levels (A1 and A2) may have different average value of X. The complication of the latter fact in modeling is that the effect of X on Y may partially or even fully explains the effect of A. I know this may be a controversial issue because X is correlated with the levels of A to some extent, but the investigator wants to account for the variability within each level of A. If I construct a model like
Y ~ X + A
Y ~ X*A
with lme4 of nlme package in R, I believe that the result of A effect from anova() should be interpreted with X taking the overall mean value, but that would not allow me to obtain the effect of A while 'controlling' for X (considering the fact that X has different mean value across the two levels of A; i.e., the average value of X at A1 is different from the average value of X at A2)! I've thought of scaling Y by X with a model like
Y/X ~ A
but I don't feel so comfortable with it. Any suggestions on modeling this situation? Is there such a thing as multivariate LME?