path model with dichotomous outcome

255 views
Skip to first unread message

Sandy Schumann

unread,
May 7, 2021, 6:12:43 AM5/7/21
to lavaan
Hi everyone,

I would like to test a path model where one variable (choice) is dichotomous (0,1). I wrote the following code:

mediatedmodel12<-'##regressions
              choice~fight+age+gender_recoded+education
              fight~RATaccuracy + WCSTaccuracy
              ##covariance
              RATaccuracy ~~ WCSTaccuracy
              age~~education
              age~~gender_recoded
              education~~gender_recoded
              ##intercepts
              choice~1
              fight~1'
fitmediated12 <- sem(mediatedmodel12, data = fulldataset, ordered = c("choice"), estimator = "WLSMV")
summary(fitmediated12, fit.measures = TRUE, standardized = TRUE)

I got the following warnings:
3: In lav_model_vcov(lavmodel = lavmodel, lavsamplestats = lavsamplestats,  :
  lavaan WARNING:
    Could not compute standard errors! The information matrix could
    not be inverted. This may be a symptom that the model is not
    identified.
4: In lav_test_satorra_bentler(lavobject = NULL, lavsamplestats = lavsamplestats,  :
  lavaan WARNING: could not invert information matrix needed for robust test statistic

as well as 
In cbind(c1, c2, c3, deparse.level = 0) :
  number of rows of result is not a multiple of vector length (arg 3)

However, the output also states that lavaan ended normally after 72 iterations.

Can I use the robust estimates from the output? Or is it not safe to do so. (This is a replication of a study, and I follow the modelling of the original author, which is why I am not testing indirect effects.)

Thank you for your help,
Sandy

Terrence Jorgensen

unread,
May 13, 2021, 11:08:10 PM5/13/21
to lavaan
  lavaan WARNING: could not invert information matrix needed for robust test statistic

Can I use the robust estimates from the output?

Not according to the warning message.  You could try another estimator, like ULSMV or PML.

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

Sandy Schumann

unread,
May 14, 2021, 4:49:01 AM5/14/21
to lavaan
Thank you so much. I used the PML estimator and the warning is no longer reported. 

Best,
Sandy

Reply all
Reply to author
Forward
0 new messages