Error Message CFA: non positive-definite covariance matrix - further inspection

372 views
Skip to first unread message

Anna Mayer

unread,
Oct 8, 2024, 4:11:16 AM10/8/24
to lavaan
Hey everyone, 

I am trying to do a CFA with the lavaan package and I am recieving an error message, I have no idea why. 

Here is my model and the command for the cfa: 

QOLIBRI_model <- 'Cognition =~ QOL_A_01 + QOL_A_02 + QOL_A_03 + QOL_A_07
          Self =~ QOL_B_02 + QOL_B_03 + QOL_B_04 + QOL_B_06
          Autonomy =~ QOL_C_01 + QOL_C_03 + QOL_C_04 + QOL_C_07
          Social =~ QOL_D_02 + QOL_D_03 + QOL_D_06
          Emotion =~ QOL_E_02 + QOL_E_03 + QOL_E_04
          Physical =~ QOL_F_01 + QOL_F_02 + QOL_F_03 + QOL_F_04 + QOL_F_05'

model_total <- cfa(QOLIBRI_model, data = data_cfa, estimator = "WLSMV", ordered = TRUE)

When I execute this, I get a warning message: 

Warnung: lavaan WARNING: The variance-covariance matrix of the estimated parameters (vcov) does not appear to be positive definite! The smallest eigenvalue (= -5.912588e-17) is smaller than zero. This may be a symptom that the model is not identified.Warnung: lavaan WARNING: covariance matrix of latent variables is not positive definite; use lavInspect(fit, "cov.lv") to investigate.
I already tried to inspect with lavInspect(model_total, "cov.lv"), but there are no negative covariances between scales. The covariance matrix seems to be ok. ANd I don´t get, why the model appears to be not identified, what that means. 

Does anyone have an idea, how to further inspect this problem or/and can explain, why lavaan prints this warning? I only have 104 observations, so I gues that maybe this could be the problem. But maybe there is something more, so I can thouroughly understand and report it in my work. 

I am gratefull for any help! 

Prof. Gavin Brown

unread,
Oct 8, 2024, 4:24:49 AM10/8/24
to lavaan
with small sample size (n=108) as you have compared to the number (k=23) of variables, lots can go wrong. My sense of the error message is that the correlations among the factors may have a value >1.00. This may be caused by a variance <0.00 (an ultra heywood case). This can be resolved in a number of ways, including (1) fixing negative error variances to a small positive number if the confidence interval goes above zero or (2) merging factors that are highly correlated or correlated beyond 1.00, or (3) making a factor subordinate to another so that there isn't a correlation. Much of this is discussed in multiple papers. I especially like the Chen et al. 2001 paper.
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
Dillon, W. R., Kumar, A., & Mulani, N. (1987). Offending estimates in covariance structure analysis: Comments on the causes of and solutions to Heywood cases. Psychological Bulletin, 101(1), 126-135.
Gerbing, D. W., & Anderson, J. C. (1987). Improper solutions in the analysis of covariance structures: Their interpretability and a comparison of alternate respecifications. Psychometrika, 52(1), 99-111. https://doi.org/10.1007/BF02293958
Kolenikov, S., & Bollen, K. A. (2012). Testing Negative Error Variances: Is a Heywood Case a Symptom of Misspecification? Sociological Methods & Research, 41, 124-167. https://doi.org/10.1177/0049124112442138
Marsh, H. W. (1998). Pairwise deletion for missing data in structural equation models: Nonpositive definite matrices, parameter estimates, goodness of fit, and adjusted sample sizes. Structural Equation Modeling: A Multidisciplinary Journal, 5, 22-36. https://doi.org/10.1080/10705519809540087 

Edward Rigdon

unread,
Oct 8, 2024, 6:50:39 AM10/8/24
to lav...@googlegroups.com
This is only a warning, not an error. You probably still have results--use summary() to take a look and see if some parameter estimates have gone off the tracks.
I don't recall exactly, but checking identification status before iterations converge is a relic from days when computer time was precious. I believe you can turn off this particular check with the option
check.vcov=F
You may need to specify starting values, in order to find a good solution space. For a lark, you might try the option
start='Mplus'
But it may come down to specifying start values for individual parameters. But don't do all that work if a simpler answer reveals itself. Given model structure, under-identification is unlikely, though bthere may be empirical under-identificatioon. But yes, n = 104 is not much for the number of free parameters in this model.

--
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/331d2074-21b7-47e6-be29-fb7ccf33f757n%40googlegroups.com.

Brydon Grant

unread,
Oct 8, 2024, 8:14:30 AM10/8/24
to lav...@googlegroups.com
Hi,  I am a novice but I have encountered this problem.  The variance-covariance may be all positive but its determinant is likely negative: check det(vcov).  The same sample size for CFA may be a problem for identification.  Check the number of parameters near the top of the output.  If it exceeds the number of observations, it is almost certainly underidentified.  Ordered data is expensive for using up degrees of freedom because it uses multiple thresholds for each level instead of one for intercept in a continuous variable.  I guess QOL is quality of life so you may be using Likert scales.  If so, you can treat these scales as continuous rather than ordered, there are several articles that discuss this matter.  After that I would use modification indices for values to eliminate values >=10, and the lav.residuals to eliminate items >= 3 and then parcelling if there is still a problem but maintaining at least 3 preferably 4 items in each latent variable.  None of that works, then I would go to exploratory factor analysis to see if the data in your sample justifies the division into these separate latent variables.  

Anna Mayer

unread,
Oct 9, 2024, 10:50:49 PM10/9/24
to lav...@googlegroups.com
Thank you all so much! 

I further inspected my results, and indeed, I have a number of model parameters 126 and observations 104, but no negative variances, but some covariances greater 1. I now tried to calculate the model again with dichotomized answers and here I don´t get the warning anymore and have model parameters 61 and observations 104. Further, the model estimators fit the data much better, so maybe this was the problem. Nonetheless, the sample size is definitely a problem and greater N would be better. Thank you all so much for your insights! 

--
You received this message because you are subscribed to a topic in the Google Groups "lavaan" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/lavaan/HKDL_KG3i50/unsubscribe.
To unsubscribe from this group and all its topics, send an email to lavaan+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lavaan/3fa72936-a64f-4270-b5d3-c4efdb82815an%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages