CFA warning messages, and no results

172 views
Skip to first unread message

Serena

unread,
Jan 28, 2024, 7:09:01 PM1/28/24
to lavaan
Hi all,

This is my first time posting here.

I am running CFA with lavaan.
I have 23 factors, 111 items, and 1840 observations.

When I run all CFAs, there are two warning messages (below). I learned that warning messages could be ignored, but I couldn't get any results (I waited for several hours). 

Appreciate any suggestions/ideas.

Warning messages:
1: In lav_model_vcov(lavmodel = lavmodel, lavsamplestats = lavsamplestats,  :
  lavaan WARNING:
    The variance-covariance matrix of the estimated parameters (vcov)
    does not appear to be positive definite! The smallest eigenvalue
    (= -7.137957e-15) is smaller than zero. This may be a symptom that
    the model is not identified.
2: In lav_object_post_check(object) :
  lavaan WARNING: some estimated lv variances are negative

Jeremy Miles

unread,
Jan 28, 2024, 11:02:09 PM1/28/24
to lav...@googlegroups.com

Second error first: When you fit a model: 
 - all variances should be positive (a variance is a sum of squares)
 - In order to make the model fit, it needs to have a negative variance. This can't exist, so it knows the model is wrong. But it's the best that lavaan can do. Your model is (probably) wrong.

First error is trickier. Lavaan thinks the model is not identified, but it's not sure. The way to be sure is to give the model different starting values. It it doesn't converge to the same place, it's not identified. Identification is a bit tricky - your model is vast, so I'm not surprised that there are issues. 

You might try fitting one factor at  a time. 

What estimator are you using? Something like ML will be faster than WLS. 

Jeremy

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/lavaan/753c0e95-9199-485d-aa04-9266558d306fn%40googlegroups.com.
Message has been deleted

Serena

unread,
Jan 29, 2024, 8:36:22 AM1/29/24
to lavaan
Thanks Jeremy,

I use MLR.

I solved the problem by removing the argument mimic = "Mplus" in the cfa() function. No more warnings and I got the results.

I am unfamiliar with Mplus, so I have no idea why this argument will cause this problem. And I am unsure if this model will work in Mplus.

Serena

Prof. Gavin Brown

unread,
Jan 29, 2024, 2:42:49 PM1/29/24
to lavaan
further to Jeremy's comments. Negative error variances can be corrected if you know that elsewhere the variance is not negative and if the 95%CI for the variance crosses zero. then you can set it to a small positive value (.005) which makes the model admissible. see
Chen, F., Bollen, K. A., Paxton, P., Curran, P. J., & Kirby, J. B. (2001). Improper solutions in structural equation models: Causes, consequences, and strategies. Sociological Methods & Research, 29(4), 468-508. https://doi.org/10.1177/0049124101029004003

Reply all
Reply to author
Forward
0 new messages