Warning: covariance matrix of latent variables is not positive definite

46 views
Skip to first unread message

fotin...@gmail.com

unread,
Aug 10, 2018, 11:21:08 AM8/10/18
to lavaan
Hi,

I have looked on the forum and this has been covered before but I am confused with my particular situation.

I am running the following code and I receive the warning message that the covariance matrix is not positive definite.  See code and results of inspect function below.  I receive good model fit so I am not sure what to do at this stage.  Is this telling me that I have to exclude PAa from my model?  I need to keep PAa in the model so I am not sure what to do at this stage if anything at all.

Thanks!


model.Rq3eq <- '
# measurement model
ERa =~ ER1 + ER2 + a4*ER3 + a2*ER4 + a3*ER5
PAa =~ PA1 + PA2 + PAMV1
ERb =~ a4*ER6 + a2*ER7 + a3*ER8
ERc =~ a4*ER9 + a2*ER10 + a3*ER11
CaAap =~ CogAbVerbMCS3BAS + CogAbNVMCS3BASPC + AcAtMCS3
AAa =~ AcAtMCS4MSS + AcAtMCS4LSS + a1*AcAtMCS4E + a2*AcAtMCS4M + a3*AcAtMCS4S + a4*AcAtMCS4IT + a5*AcAtMCS4ADM + a6*AcAtMCS4PE
AAb =~ a1*AcAtMCS5E + a2*AcAtMCS5M + a3*AcAtMCS5S + a4*AcAtMCS5IT + a5*AcAtMCS5AD + a5*AcAtMCS5Mus + a6*AcAtMCS5PE
#Thresholds
ER3 | c1*t1 + c2*t2; ER9 | c1*t1 + c2*t2; ER6 | c1*t1 + c2*t2
ER4 | d1*t1 + d2*t2; ER10 | d1*t1 + d2*t2; ER7 | d1*t1 + d2*t2
ER5 | e1*t1 + e2*t2; ER11 | e1*t1 + e2*t2; ER8 | e1*t1 + e2*t2
AcAtMCS4E  | h1*t1 + h2*t2 + h1*t3 + h1*t4; AcAtMCS5E  | h1*t1 + h2*t2 + h1*t3 + h1*t4
AcAtMCS4M  | i1*t1 + i2*t2 + i1*t3 + i1*t4; AcAtMCS5M  | ii1*t1 + i2*t2 + i1*t3 + i1*t4
AcAtMCS4S  | j1*t1 + j2*t2 + j1*t3 + j1*t4; AcAtMCS5S  | j1*t1 + j2*t2 + j1*t3 + j1*t4
AcAtMCS4IT  | k1*t1 + k2*t2 + k1*t3 + k1*t4; AcAtMCS5IT  | k1*t1 + k2*t2 + k1*t3 + k1*t4
AcAtMCS4ADM  | l1*t1 + l2*t2 + l1*t3 + l1*t4; AcAtMCS5AD  | l1*t1 + l2*t2 + l1*t3 + l1*t4; AcAtMCS5Mus | l1*t1 + l2*t2 + l1*t3 + l1*t4
AcAtMCS4PE  | m1*t1 + m2*t2 + m1*t3 + m1*t4; AcAtMCS5PE  | mm1*t1 + m2*t2 + m1*t3 + m1*t4
# regressions
# a Path
ERa ~ a * PAa
ERc ~ d * PAa
# b path
AAa ~ b1 * ERa + b2 * CaAap
AAb ~ e1 * ERa + e2 * CaAap
#c prime path
AAa ~ cp * PAa
AAb ~ fp * PAa
#Indirect and total effects
ab := a * (b1 + b2)
total := cp + ab
de := d * (e1 + e2)
totali := fp + de'
fit.M3 <- sem(model.Rq3eq, data=imputeFMoutliersRC, std.lv = TRUE, estimator="WLSMV")


> inspect(fit.M3,"cor.lv")
             ERa    PAa    ERb    ERc    CaAap  AAa    AAb   
ERa    1.000                                          
PAa   -0.794  1.000                                   
ERb    0.303 -0.382  1.000                            
ERc    0.625 -0.788  0.301  1.000                     
CaAap  0.678 -0.854  0.407  0.673  1.000              
AAa    0.797 -0.657  0.259  0.252  0.587  1.000       
AAb    0.236 -0.649  0.229  0.925  0.491  0.335  1.000

Terrence Jorgensen

unread,
Aug 14, 2018, 6:11:08 AM8/14/18
to lavaan
Is this telling me that I have to exclude PAa from my model? 

I'm not sure why you are singling out this one factor.  I don't see any Heywood cases in your latent correlation matrix, so I think the linear dependency is instead due to (multi)collinearity.  Without it being a specific parameter to test whether the CI includes acceptable values (http://journals.sagepub.com/doi/abs/10.1177/0049124112442138), it is not straight-forward to find out why it is a NPD matrix.  But if your model fits well, I would not let this warning prevent you from proceeding.

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

Reply all
Reply to author
Forward
0 new messages