Hi everyone
Please help
Am trying to run Multiple Group CFA for ordinal data in lavaan, the following is the error am getting.
model1.fit <- cfa(model1, ordered = c("gh1","gh2","gh3","gh4","gh5","gh6.1","gh7","gh8","gh9","gh10","gh11","gh12"),data=dat, group = "countrycode1",missing = "pairwise") Error in lav_samplestats_step1(Y = Data, ov.names = ov.names, ov.types = ov.types, : lavaan ERROR: some categories of variable `gh10' are empty in group 1; frequencies are [139 23 7 0]
Error in lav_samplestats_step1(Y = Data, ov.names = ov.names, ov.types = ov.types, : lavaan ERROR: some categories of variable `gh10' are empty in group 1; frequencies are [139 23 7 0]
I was unable to collapse a pair of adjacent categories when one group has zero in a category in lavaan. I identified those groups with zero frequencies.
When I get rid of those questions with zero frequencies in these groups, the lavaan is converging. I will appreciate, if can guide me how to collapse them, for lavaan to converge.
Thanks.
Regards,
Paul
I identified those questions with zero frequencies in some groups
table(myData$var1, myData$group)
myData$var1.collapsed <- ifelse(myData$var1 == 3, yes = 2, no = myData$var1)