Error: NAs are not allowed in subscripted assignments

122 views
Skip to first unread message

Sandra Jaworeck

unread,
May 15, 2020, 2:51:01 AM5/15/20
to lavaan
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.

Terrence Jorgensen

unread,
May 15, 2020, 10:51:42 AM5/15/20
to lavaan
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!" 

Older versions did not include functionality that does not currently exist.  lavaan has yet to accommodate ordinal multilevel data in any version.

Terrence D. Jorgensen
Assistant Professor, Methods and Statistics
Research Institute for Child Development and Education, the University of Amsterdam
 

Terrence Jorgensen

unread,
May 15, 2020, 10:53:28 AM5/15/20
to lavaan
Older versions did not include functionality that does not currently exist.  lavaan has yet to accommodate ordinal multilevel data in any version.

This might be a solution for you:  https://doi.org/10.1080/10705511.2019.1689366

Sandra Jaworeck

unread,
May 16, 2020, 4:28:43 AM5/16/20
to lavaan
Thank you very mutch Terrence Jorgensen! I will try this out.

Regards,
Sandra.

Reply all
Reply to author
Forward
0 new messages