To answer my research question, I need to determine whether the random intercepts affect the random slopes. Unfortunately, the estimated covariance is rather small, which I suspect may be due to characteristics of my independent variable. Therefore, I would like to calculate the correlation between them manually.
I couldn’t find a specific option to directly display the correlation in my model code (mixed dep.var. ind.var. c.age##c.age || cid: randomslope, mle var cov(uns)). However, as I understand it, the correlation can be computed using this formula:
covariance/ √((varintercept) * var(slope)
Based on the random-effects output:
Random-effects parameters | Estimate Std. err. [95% conf. interval]
-----------------------------+------------------------------------------------
cid: Unstructured |
var(z_opcha_pc) | .0213654 .0082598 .0100147 .045581
var(_cons) | .2529837 .0856323 .1303076 .4911511
cov(z_opcha_pc,_cons) | .0478774 .021923 .0049092 .0908456
-----------------------------+------------------------------------------------
var(Residual) | 4.558039 .039193 4.481866 4.635507
The resulting correlation should be: 0.04788/√(0.02137*0.25298) = 0.6514.
This value aligns surprisingly well with my hypothesis, which makes me wonder whether I might be overlooking something. I’d appreciate any input or critical feedback and thank you very much for your time and support!
I couldn’t find a specific option to directly display the correlation in my model code (mixed dep.var. ind.var. c.age##c.age || cid: randomslope, mle var cov(uns)). However, as I understand it, the correlation can be computed using this formula:
covariance/ √((varintercept) * var(slope)
Based on the random-effects output:
Random-effects parameters | Estimate Std. err. [95% conf. interval]
-----------------------------+------------------------------------------------
cid: Unstructured |
var(z_opcha_pc) | .0213654 .0082598 .0100147 .045581
var(_cons) | .2529837 .0856323 .1303076 .4911511
cov(z_opcha_pc,_cons) | .0478774 .021923 .0049092 .0908456
-----------------------------+------------------------------------------------
var(Residual) | 4.558039 .039193 4.481866 4.635507
The resulting correlation should be: 0.04788/√(0.02137*0.25298) = 0.6514.
This value aligns surprisingly well with my hypothesis, which makes me wonder whether I might be overlooking something. I’d appreciate any input or critical feedback and thank you very much for your time and support!
Comment