I would like to calculate confirmatory factor analysis (CFA) with ordinal data in R, using lavaan. The data is taken from a questionnaire containing 16 elements structured on the Likert scale.
I believe that a 4-factor model works best for my data. To calculate CFA, I looked for information and found a useful recommendation in this one.
The recommendation is to use DWLS estimation and polychoric correlation. I was able to calculate CFA with DWLS in Rusing a package lavaan. I found out that in Mplus the evaluation of DWLS or WLSMV, which is the same, uses polychoric correlation , unfortunately, I never used Mplus and would like to work with R, so I was wondering if lavaanthis is the same.
So far, I have calculated CFA as follows:
I indicated a model (model 4) with 4 factors (AV, AW, AB, AA), (each factor has 4 elements)
model.4='
AV =~ AVf1_+AVf2+AVf3+AVf4
AW =~ AWf1+AW2+AWf3+AWf4
AB =~ ABf1+ABf2+ABf3+ABf4
AA =~ AAf1+AAf2+AAf3+AAf4'
Then I used a function "ordered"due to my ordered data, which is recommended in the packagelavaan
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"))
. (CFI, RMSEA ..). : , Mplus? - ? lavaan , lavCor, , , , , .
:
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"))
))
> summary(model.ord1, fit=T) . .
: CFA ? , ?