# Lavaan Error - trying to calculate a CFA

Hey, I need some help with lavaan and CFA!
Thats the code:

str(Daten)
ASPI <- "
AE =~ sp1_1 + sp8_1 + sp12_1 + sp17_1 + sp20_1 + sp24_1 + sp25_1 + sp32_1 + sp36_1 + sp43_1 + sp44_1
PP =~ sp2_1 + sp5_1 + sp13_1 + sp14_1 + sp15_1 + sp16_1 + sp19_1 + sp21_1 + sp22_1 + sp23_1 + sp26_1 + sp38_1
SE =~ sp6_1 + sp10_1 + sp29_1 + sp31_1 + sp33_1 + sp35_1 + sp39_1 + sp40_1 + sp41_1
BC =~ sp4_1 + sp11_1 + sp18_1 + sp27_1 + sp30_1 + sp37_1 + sp42_1
IC =~ sp3_1 + sp7_1 + sp9_1 + sp28_1 + sp34_1
"
CFA_ASPI <- cfa(model=ASPI, data=Daten, estimator = "mlr")
summary(CFA_ASPI, fit.measures = TRUE, standardized = TRUE)

The error message when trying to run "CFA_ASPI <-..." says:

Error in lav_data_full(data = data, group = group, cluster = cluster, :
lavaan ERROR: unordered factor(s) detected; make them numeric or ordered: sp1_1 sp8_1 sp12_1 sp17_1 sp20_1 sp24_1 sp25_1 sp32_1 sp36_1 sp43_1 sp44_1 sp6_1 sp10_1 sp29_1 sp31_1 sp33_1 sp35_1 sp39_1 sp40_1 sp41_1 sp4_1 sp11_1 sp18_1 sp27_1 sp30_1 sp37_1 sp42_1 sp3_1 sp7_1 sp9_1 sp28_1 sp34_1

What do I do now? All the variables are at least scaled metric. These are items of a questionnaire with a likert scale from 1 to 5.

I would be very grateful if someone could help me!

Best,
Lucca

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.