some categories of variable `PL3' are empty in group 2.
I have this problem also with other scales and items which have an extreme skewness, because group 2 is very small (n=150).
No I was wondering how to deal with this. The two options which came up to my mind were first, deleting the whole item from the analysis, or second, doing a measurement analysis for continous data, because then this problem doesn't occur anymore. Of course, I'm not satisfied with either of these solutions.
Is there anything else you can think of?
Thanks,
Isabella
Is it okey to select one case in group 2, and changed the response of variable `PL3' to an adjacent one to avoid such "empty category problem".It seems that this trick will make little difference to the model.
I also have this problem. The top level of one variable in my model (V49) is empty for some groups (two countries, Denmark and Russia). I tried to change one response in each of these countries, by picking one random record from each group and manually changing two responses as follows:
set.seed(1234)
ind.1 <- which(df[,"COUNTRY.NAME"] %in% "DK-Denmark" & df[,"V49"] %in% "Weekly")
ind.2 <- which(df[,"COUNTRY.NAME"] %in% "RU-Russia" & df[,"V49"] %in% "Weekly")
df$V49[sample(ind.1,1)] <- "Daily"
df$V49[sample(ind.2,1)] <- "Daily"
When I inspect the data frame with "table" prior to analysis, the two changed responses are shown correctly (other countries omitted):
> table(df$V49,df$COUNTRY.NAME)[,c(6,19)]
DK-Denmark RU-Russia
Never 827 292
Yearly 501 416
Monthly 85 52
Weekly 316 15
Daily 1 1
However, "cfa" again complains that the counts are zero for one group, and the error message shows a vector of counts that I cannot relate to any of the results from"table" :
> # CONFIGURAL
> config <- measEq.syntax(configural.model = model, data = df, parameterization = "theta",
+ ID.fac = "std.lv", ID.cat = "Wu.Estabrook.2016",
+ group = "COUNTRY.NAME", group.equal = "", return.fit = TRUE)
Error in lav_samplestats_step1(Y = Data, ov.names = ov.names, ov.types = ov.types, :
lavaan ERROR: some categories of variable `V49' are empty in group 18; frequencies are [128 139 18 8 0]
I tried three solutions that worked: changing 10 cases in each of the two groups instead of one, merging the two top levels for the variable, and removing the two groups from the analysis.
The first solution is obviously not acceptable. The second and third are better, but far from good.
I'm trying now multiple imputations, because the data frame also has a substantial proportion of missing values.
But what I do not understand is why after changing the values manually and inspecting with "table" , "cfa" still issues the error message.
Carlos M. Lemos
--
You received this message because you are subscribed to the Google Groups "lavaan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lavaan+un...@googlegroups.com.
To post to this group, send email to lav...@googlegroups.com.
Visit this group at https://groups.google.com/group/lavaan.
For more options, visit https://groups.google.com/d/optout.
The first solution is obviously not acceptable.
The second and third are better, but far from good.
I don't understand these messages well.
Also, it seems that fitMeasures() does not accept the arguments test and pool.robust.
I have the following doubts: how does fitMeasures() pool the cfi, rmsea and srmr that are needed for the invariance tests?
Which fit measures can be pooled and which cannot?(I read this paper on using imputation in regression models:which states that some statistics can be combined using Rubin's rules, but others cannot).
When collapsing two adjacent response categories, would you do this (a) for only the item that has the empty response category or (b) for all items (i.e., even for those that contain no empty response categories)?