Polychoric correlation matrix with significance in R
Asked Answered
M

1

6

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

Mathison answered 21/10, 2013 at 22:46 Comment(0)
I
8

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)  
Inutility answered 2/5, 2014 at 17:9 Comment(2)
Thank you for your answer. I am no longer working on this project, but I'll surely try this out next time I need the polychoric correlation matrix.Franks
Did you mean corr.p(ply.examples$rho)? because the rho is already an correlation matrix.Seasoning

© 2022 - 2024 — McMap. All rights reserved.