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?
coef(model)$subject, do the manual addition and then calculate the correlation withcor()but I also know it is not advisable to work with concrete values of latent variables for a reason that is, to be hones, not entirely clear to me (in factor analysis it is about factor indeterminacy, but here, I am not sure). P.S. If I don't "need" the correlation between X and X:ConditionB, is it at all justified to estimate it, or is it better to set it to 0? $\endgroup$it is not advisable to work with concrete values of latent variables- but this is not what I meant. My (implicit) suggestion was to work out corr(A+B, A) directly from var(A), var(B), and cov(A, B). Hint: cov(A+B,A) = cov(A,A)+cov(A,B) = var(A) + cov(A,B). $\endgroup$