Search code examples
rr-lavaanstructural-equation-model

Lavaan - can the variance-covariance matrix be not positive definite due to binary variables?


I am relatively new to lavaan and structural equation modelling in general and would be really grateful for any help with the following problem:

I have been trying to set up a latent change model in R using lavaan, using the basic setup outlined in Kievit et al (2018) (https://www.sciencedirect.com/science/article/pii/S187892931730021X). I am trying to model changes in depression pre to post COVID, and to determine predictors of this change (e.g. socio-economic status, social support etc).

When I run the model, I get the warning "The variance-covariance matrix of the estimated parameters (vcov) does not appear to be positive definite! The smallest eigenvalue (= -7.520784e-18) is smaller than zero. This may be a symptom that the model is not identified."

I have tried to do some trouble-shooting, and it seems like problem only comes up when I include binary predictors of the latent change score (I have both binary (coded 0-1) and continuous predictors in the model at the moment). Otherwise, the model seems to estimate normally. In a forum, I saw someone argue that lavaan computes integration and that "binary/ordinal variables require numeric integration over the distributions of latent variables, and do not lend themselves to analytic differentiation".

My question is: could including binary predictor variables be the reason for the identification problem? And if yes, how would I solve this in lavaan? I would also be happy to provide an example of the code if this helps. Any help and thoughts would really be appreciated!


Solution

  • I get the warning "The variance-covariance matrix of the estimated parameters (vcov) does not appear to be positive definite! The smallest eigenvalue (= -7.520784e-18) is smaller than zero. This may be a symptom that the model is not identified."

    This message is telling you that at least 2 parameter estimates are highly collinear. Did you set fixed.x=FALSE? The mean and variance of binary variables are collinear (both based on $\pi$: https://mathworld.wolfram.com/BinomialDistribution.html). So if they are estimated for a binary predictor, this message is quite common and can be ignored if there are no other signs of underidentification (e.g., you said the message only appears when including binary predictors). Linda K. Muthen posted a similar response on the Mplus forum February 01, 2013: http://www.statmodel.com/discussion/messages/11/1602.html?1597708138