How do I extract the Correlation of fixed effects part of the lmer output

独自空忆成欢 提交于 2019-11-30 15:19:28

Using the S4 method listing function we can return the function which is dispatched when print is called on an object of class "mer":

selectMethod( print , "mer" )

Looking at the source code that is returned we can find the lines applicable to you:

if (correlation) {
            corF <- so@vcov@factors$correlation

so is defined as the summary of your object, so in your case you should just need to extract:

so <- summary(mod)
so@vcov@factors$correlation

How about using the built-in

cov2cor(vcov(mod))

?

I don't know direct method. But this is workaround.

 diag(diag(1/sqrt(vcov(mod)))) %*% vcov(mod) %*% diag(diag(1/sqrt(vcov(mod))))
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!