2013-10-21 51 views
2

我一直在急切地寻找一种计算多方相关矩阵的方法,在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) 

这些都不放弃的意义。我已经读过Permutation测试[可以给我意义] [1],用于每个相关对的corr = 0假设。软件包和lmPerm允许用户计算排列测试。但是,我不确定如何。

在此先感谢, 海尔吉

回答

4

很抱歉这么晚才回复。可以指定poly = TRUE。比尔最近也改变了cor.plot,使其扩展与对比意义的文字大小,但你可能必须从我们的服务器上安装最新的斗志包:

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) 
+0

谢谢您的回答。我不再在这个项目上工作,但下次我需要多边形相关矩阵时,我一定会尝试一下。 –

+0

您的意思是corr.p(ply.examples $ rho)吗?因为rho已经是一个相关矩阵。 –