I have several binary variables (say, Y1, Y2, Y3, and Y4) and a few covariates (e.g. X1, X2, X3).
I have made the Y variables ordered (to get DWLS) and ran the following codes in lavaan.
mod1 <- '
Y1 ~ Y2 + Y3 + X1 + X2 + X3
Y2 ~ Y1 + Y3 + X1 + X2 + X3
Y3 ~ Y1 + Y2 + X1 + X2 + X3
Y4 ~ Y1 + Y2 + Y3 + X1 + X2 + X3
'
fit1 <- sem(mod1, data=dat)
summary(fit1, standardized=TRUE)
But that shows me the following warning:
Warning message:
In lav_model_vcov(lavmodel = lavmodel, lavsamplestats = lavsamplestats, :
lavaan WARNING: could not compute standard errors!
lavaan NOTE: this may be a symptom that the model is not identified.
I saw on the web that when the number of "knowns" is fewer than the number of "unknowns" then the model becomes "not identified". So, I removed all covariates to reduce the number of parameters to be estimated.
mod2 <- '
Y1 ~ Y2 + Y3
Y2 ~ Y1 + Y3
Y3 ~ Y1 + Y2
Y4 ~ Y1 + Y2 + Y3
'
fit2 <- sem(mod2, data=dat)
summary(fit2, standardized=TRUE)
But this still shows me the same warnings.
However, when I run the model (note, with all covariates but not testing bidirectional relationships) as follows:
mod3 <- '
Y1 ~ X1 + X2 + X3
Y2 ~ Y1 + X1 + X2 + X3
Y3 ~ Y1 + Y2 + X1 + X2 + X3
Y4 ~ Y1 + Y2 + Y3 + X1 + X2 + X3
'
fit3 <- sem(mod3, data=dat)
summary(fit3, standardized=TRUE)
this doesn't show me the warning anymore. But this is not what I wanted to test.
I cannot understand what are the knowns and unknowns here and why my second attempt (mod2) doesn't work even after reducing the number of parameters to be estimated.
It seems to me like either testing bidirectional relationships are not allowed or that I'm making a mistake here. Could anyone please clarify why it is happening? I really appreciate your comments.