在R中具有意义的多色相关矩阵 [英] Polychoric correlation matrix with significance in R

查看:139
本文介绍了在R中具有意义的多色相关矩阵的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在拼命地寻找一种在R中具有显着性的多元选择矩阵的计算方法.如果这很难,那么两个具有显着性的变量之间的多元选择就足够了.

到目前为止我尝试过的事情:

library(polychor)
poly <- polychor(var1,var2)
poly <- polychor(DatM) #where DatM is a DF converted to matrix

library(polycor)
hetcor(Dat2) #I am however uncertain hetcor is something I would want if I am looking for polychoric correlation.

library(psych)
polychoric(Dat$for2a,smooth=TRUE,global=TRUE,polycor=FALSE, ML = FALSE, std.err=TRUE)

这些都没有意义.我已经读过针对每个相关对的corr = 0假设的置换检验[可能会给我带来意义] [1].硬币和lmPerm软件包确实允许人们计算置换测试.但是,我不确定如何.

先谢谢了, 赫尔吉(Helgi)

解决方案

对不起,您的答复很晚.

cor.ci 可能就是您想要的,因为您可以指定poly = TRUE. Bill最近还修改了cor.plot,以便它具有相关的重要性来缩放文本大小,但是您可能必须从我们的服务器上安装最新的psych软件包:

install.packages('psych', type = 'source', repos = 'http://personality-project.org/r/')

这是一个简短的示例:

library(psych)
poly.example <- cor.ci(sim.poly(nvar = 10,n = 100)$items,n.iter = 10,poly = TRUE)
poly.example
print(corr.test(poly.example$rho), short=FALSE)  

I have been desperately looking for a way to compute a polychoric correlation matrix, with significance in R. If that is very hard then polychoric correlation between two variables with significance would be sufficient.

What I have tried so far:

library(polychor)
poly <- polychor(var1,var2)
poly <- polychor(DatM) #where DatM is a DF converted to matrix

library(polycor)
hetcor(Dat2) #I am however uncertain hetcor is something I would want if I am looking for polychoric correlation.

library(psych)
polychoric(Dat$for2a,smooth=TRUE,global=TRUE,polycor=FALSE, ML = FALSE, std.err=TRUE)

None of these give significance. I have read that the Permutation test [could give me significance][1] for the corr=0 hypothesis for each correlation pair. The packages coin and lmPerm do allow one to compute the Permutation test. However, I am unsure how.

thanks in advance, Helgi

解决方案

Sorry for the late reply.

cor.ci may be what you want, as you can specify poly = TRUE. Bill also recently altered cor.plot so that it scales the text size with the correlation significance, but you may have to install the latest psych package from our server:

install.packages('psych', type = 'source', repos = 'http://personality-project.org/r/')

Here is a brief example:

library(psych)
poly.example <- cor.ci(sim.poly(nvar = 10,n = 100)$items,n.iter = 10,poly = TRUE)
poly.example
print(corr.test(poly.example$rho), short=FALSE)  

这篇关于在R中具有意义的多色相关矩阵的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆