Hi everyone,
I work not with the current lavaan version (I use 0.6-4) because I got from Yves Rosseel l the hint:
"Note that multilevel SEM currently (0.6-5/0.6-6) does not work with
ordered/categorical data!"
My first step after loading the data was to clean up the NAs:
sun <- na.omit(df_sun)
I have specified my multi-level model like this:
model <-'
level:1
SRH ~ sunshine
level:2
SRH ~ b * sunshine + c * D_lat
sunshine ~ a * D_lat
indirect := a*b
direct := c
total := indirect + direct'
Whereby
sunshine ist metric, SRH ist an ordered factor and endogenous variable
and D_lat is a dummy variable and exogen. I try to fit:
fit <- sem(model = model,
data = sun,
cluster = "country",
ordered = c("SRH")
)
I get that Error-Message: Error in Sigma.W.tilde[ov.idx[[1]], ov.idx[[1]]] <- Sigma.W : NAs are not allowed in subscripted assignments
I
don't understand the error, because I have no NAs in my used data. I
tried a lot of other older lavaan versions and I get everytime the same
error. Can someone help me, please?
Sandra.