We have the following model:
Y ~ X*Condition + (X*Condition|subject)
- Y = dichotomous variable; values 0,1
- X = continous variable; values ca. 0-3000
- Condition = dichotomous variable; values A,B
- subject = grouping variable, 219 subjects
The experiment we conducted is a two-choice task where people have to choose the correct answer. There are two conditions in the task (condition A and B), one of which makes the task harder. The design of experiment is repeated - all participants have values for x and y in both Condition A and Condition B.
Now, I want to get the correlation of random slopes (X) between Condition A and Condition B. In a attr(VarCorr(model),"correlation")
of the above postulated model, I get this:
(Intercept) X ConditionB X:ConditionB
(Intercept) 1.0000000 -0.6398171 -0.56397675 0.57414877
X -0.6398171 1.0000000 -0.11525897 -0.98347634
ConditionB -0.5639767 -0.1152590 1.00000000 0.08207216
X:ConditionB 0.5741488 -0.9834763 0.08207216 1.00000000
It would seem that the correlation I look for is -0.98347634. However, that is not the case. I am looking for correlation between the random slope for reference Condition A (which equals coef(model)$subject$X
), and random slope for Condition B (which equals coef(model)$subject$X + coef(model)$subject$X:ConditionB
).
Instead, I get the correlation (-.983476) of coef(model)$subject$X
and coef(model)$subject$X:ConditionB
.
Can someone point me in the right direction?