Using CFA with Ordinal Data and Polychoric Correlation in Lavaan R Package

I’m conducting a Confirmatory Factor Analysis (CFA) with ordinal data using the lavaan package in R. The data comes from a survey that includes 16 Likert-scale items. I suspect a 4-factor model fits my data best. While researching, I found a recommendation to use DWLS estimation along with polychoric correlation. I haven’t used Mplus before and prefer to work with R.

Here’s how I specified my model with lavaan:

model.4=' AV =~ AVf1_+AVf2+AVf3+AVf4 
AW =~ AWf1+AW2+AWf3+AWf4 
AB =~ ABf1+ABf2+ABf3+ABf4 
AA =~ AAf1+AAf2+AAf3+AAf4 '

I utilized the ordered function for the CFA given our ordered data:

model.ord = cfa(model.4, data=Data, ordered=c(
"AVf1","AVf2","AVf3","AVf4",
"AWf1","AWf2","AWf3","AWf4",
"ABf1","ABf2","ABf3","ABf4",
"AAf1","AAf2","AAf3","AAf4"))

This ran successfully, producing the relevant fit indices. My question is whether this method automatically uses polychoric correlation like Mplus does? If not, how can I adjust my function to implement polychoric correlation? I tried using lavCor, but it didn’t work as expected:

model.ord1 <- lavCor(cfa(model.4, data=Data, ordered=c(
 "AVf1","AVf2","AVf3","AVf4",
"AWf1","AWf2","AWf3","AWf4",
"ABf1,"ABf2","ABf3","ABf4",
"AAf1","AAf2","AAf3","AAf4"))

The summary function didn’t provide any results. Can anyone help clarify if polychoric correlation is used here, and if not, how to incorporate it properly?

Hey there, ExploringForest! :wave: Your question about polychoric correlations in CFA is super interesting. I’ve been playing around with lavaan too, and it can be a bit tricky sometimes!

So, here’s the deal: when you use that ‘ordered’ argument in cfa(), lavaan doesn’t automatically use polychoric correlations like Mplus does. But don’t worry, it’s still handling your ordinal data properly!

What lavaan does is use a method called DWLS (Diagonally Weighted Least Squares) by default for ordinal data. It’s pretty smart and works with the underlying correlation structure of your Likert items.

If you really want to see those polychoric correlations, you could try something like this:

library(lavaan)
library(polycor)

# Get polychoric correlations
poly_cor <- hetcor(Data)$correlations

# Use in your CFA
model.ord <- cfa(model.4, sample.cov = poly_cor, sample.nobs = nrow(Data),
                 estimator = 'DWLS', ordered = TRUE)

This way, you’re explicitly calculating the polychoric correlations and feeding them into your CFA model. Cool, right?

Have you tried this approach before? I’m curious to hear if it makes a difference in your results! And hey, what kind of research are you doing with this CFA? Sounds fascinating!

hey there! lavaan’s pretty smart with ordinal data. when u use ‘ordered’, it handles things right for likert scales. it uses DWLS by default, which is good for ordinal stuff.

if u wanna be super clear, try this:

model.ord = cfa(model.4, data=Data, ordered=c(…),
estimator=‘DWLS’, parameterization=‘delta’)

that’ll make sure it treats ur data right. hope this helps!

Your approach with lavaan is on the right track, but there’s a bit more nuance to it. When you use the ordered argument in cfa(), lavaan doesn’t automatically use polychoric correlations, but it does set up the analysis to handle ordinal data appropriately.

For ordinal data, lavaan defaults to the DWLS (Diagonally Weighted Least Squares) estimator, which is suitable for your Likert-scale items. This estimator works with the underlying correlation matrix of your ordinal variables, which is essentially what polychoric correlations represent.

If you want to be explicit about using polychoric correlations, you can specify the estimator in your cfa() call:

model.ord = cfa(model.4, data=Data, ordered=c(...),
                estimator='DWLS', parameterization='delta')

This setup ensures that lavaan treats your data as ordinal and uses an appropriate estimation method. The parameterization='delta' argument is often recommended for ordinal CFA.

As for lavCor(), it’s not typically used for model fitting. It’s more for examining the correlation structure of your data. If you want to see the polychoric correlations, you could use:

polycor_matrix <- lavCor(Data, ordered=names(Data))

This will give you the polychoric correlation matrix for your variables, which you can examine separately from your CFA model.