Polychoric correlations syntax

35 views
Skip to first unread message

Jonil Ursin

unread,
Dec 20, 2022, 2:41:54 AM12/20/22
to lavaan
Hi 

I have a dataset with nine observed variables. The data is ordinal and I want to create a 3 factor model. I want to first check the polychoric correlations matrix of the data. What is the correct syntax to use for this? 

I have used lavCor(df, ordered = TRUE) from the lavaan package, and POLYCHOR_R(df) from the EFA.dimensions package. They give me different outputs. The matrices differ by quite a bit. 

Which is the correct one to use? 


Kind regards 

Jonil 

Terrence Jorgensen

unread,
Jan 18, 2023, 9:55:45 AM1/18/23
to lavaan
I have used lavCor(df, ordered = TRUE) from the lavaan package

TRUE works for the lavaan() function and wrappers, but I think you need to explicitly list your variable names (or declare them as ordered factors in your data.frame) for the lavCor() function.
 
POLYCHOR_R(df) from the EFA.dimensions package

The help page says this function just uses psych::polychoric().  

polychoric(lsat6)

   Q1   Q2   Q3   Q4   Q5  
Q1 1.00                    
Q2 0.17 1.00              
Q3 0.23 0.19 1.00          
Q4 0.11 0.11 0.19 1.00    
Q5 0.07 0.17 0.11 0.20 1.00


lavCor(as.data.frame(lsat6), ordered = paste0("Q", 1:5))

      Q1    Q2    Q3    Q4    Q5
Q1 1.000                        
Q2 0.170 1.000                  
Q3 0.228 0.189 1.000            
Q4 0.107 0.111 0.187 1.000      
Q5 0.067 0.172 0.105 0.201 1.000


Terrence D. Jorgensen
Assistant Professor, Methods and Statistics
Research Institute for Child Development and Education, the University of Amsterdam

Reply all
Reply to author
Forward
0 new messages