I have a latent variable change model I have fit below. I have measurements at 2 time points and I have 3 groups. When I include all 3 groups, I get the standard "Warning message: In lav_object_post_check(object) : lavaan WARNING: some estimated lv variances are negative" ". I copy the output below for the model with 3 groups. However, when I drop one of the groups (that seems to be the problem), the code runs fine. So this leads me to believe that this is NOT a model mis-specification issue but, rather, something with the data of the group I dropped. I do know the post-scores decrease some, relative to the pre-scores, for that group and I am wondering if that might be contributing to the problem. I don't see any extreme values (i.e. outliers) that might cause this issue. Any thoughts on what might be driving the error and how to deal with it? I can provide the output for running the model when I drop the one group, if that is helpful.
post.wm=~1*RSpan2+equal(pre.wm=~SSpan1)*SSpan2 #Specifies the measurement model for post.wm
RSpan2~~equal("RSpan1~~RSpan1")*RSpan2 #Allows residual variance on RSpan at T2
SSpan2~~equal("SSpan1~~SSpan1")*SSpan2 #Allows residual variance on SSpan at T2
fitmod2 <- lavaan(mod2, data=all,group='Group' , estimator='mlr',fixed.x=T,missing='fiml') #fixed.x=T regards all exogenuous covariates as estimated
Warning message:
In lav_object_post_check(object) :
lavaan WARNING: some estimated lv variances are negative
> summary(fitmod2, fit.measures=TRUE, standardized=TRUE, rsquare=TRUE)
lavaan 0.6-3 ended normally after 55 iterations
Optimization method NLMINB
Number of free parameters 42
Number of equality constraints 3
Number of observations per group
1 70
2 78
5 99
Number of missing patterns per group
1 2
2 2
5 2
Estimator ML Robust
Model Fit Test Statistic 5.252 5.775
Degrees of freedom 3 3
P-value (Chi-square) 0.154 0.123
Scaling correction factor 0.909
for the Yuan-Bentler correction (Mplus variant)
Chi-square for each group:
1 5.252 5.775
2 0.000 0.000
5 0.000 0.000
Model test baseline model:
Minimum Function Test Statistic 271.474 234.809
Degrees of freedom 18 18
P-value 0.000 0.000
User model versus baseline model:
Comparative Fit Index (CFI) 0.991 0.987
Tucker-Lewis Index (TLI) 0.947 0.923
Robust Comparative Fit Index (CFI) 0.990
Robust Tucker-Lewis Index (TLI) 0.940
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -1149.830 -1149.830
Scaling correction factor 0.984
for the MLR correction
Loglikelihood unrestricted model (H1) -1147.204 -1147.204
Scaling correction factor 1.049
for the MLR correction
Number of free parameters 39 39
Akaike (AIC) 2377.661 2377.661
Bayesian (BIC) 2514.527 2514.527
Sample-size adjusted Bayesian (BIC) 2390.897 2390.897
Root Mean Square Error of Approximation:
RMSEA 0.095 0.106
90 Percent Confidence Interval 0.000 0.228 0.000 0.242
P-value RMSEA <= 0.05 0.226 0.192
Robust RMSEA 0.101
90 Percent Confidence Interval 0.000 0.225
Standardized Root Mean Square Residual:
SRMR 0.012 0.012
Parameter Estimates:
Information Observed
Observed information based on Hessian
Standard Errors Robust.huber.white
Group 1 [1]:
Latent Variables:
Estimate Std.Err z-value P(>|z|) Std.lv Std.all
pre.wm =~
RSpan1 1.000 0.722 0.691
SSpan1 1.000 0.722 0.783
post.wm =~
RSpan2 1.000 0.770 0.713
SSpan2 (SSp1) 1.030 0.300 3.440 0.001 0.793 0.810
dCOG1 =~
post.wm 1.000 0.541 0.541
Regressions:
Estimate Std.Err z-value P(>|z|) Std.lv Std.all
post.wm ~
pre.wm 1.000 0.938 0.938
dCOG1 ~
pre.wm -0.099 0.203 -0.486 0.627 -0.171 -0.171
Covariances:
Estimate Std.Err z-value P(>|z|) Std.lv Std.all
.RSpan1 ~~
.RSpan2 0.262 0.164 1.598 0.110 0.262 0.458
.SSpan1 ~~
.SSpan2 0.028 0.154 0.185 0.854 0.028 0.086
Intercepts:
Estimate Std.Err z-value P(>|z|) Std.lv Std.all
.post.wm 0.000 0.000 0.000
.dCOG1 0.151 0.091 1.660 0.097 0.362 0.362
pre.wm 0.003 0.118 0.028 0.978 0.005 0.005
.RSpan1 0.000 0.000 0.000
.SSpan1 (.21.) 0.061 0.094 0.655 0.513 0.061 0.067
.RSpan2 0.000 0.000 0.000
.SSpan2 (SS1~) 0.061 0.094 0.655 0.513 0.061 0.063
Variances:
Estimate Std.Err z-value P(>|z|) Std.lv Std.all
.post.wm 0.000 0.000 0.000
.dCOG1 0.168 0.112 1.504 0.133 0.971 0.971
pre.wm 0.522 0.118 4.408 0.000 1.000 1.000
.RSpan1 (.16.) 0.571 0.191 2.985 0.003 0.571 0.523
.SSpan1 (.17.) 0.330 0.160 2.061 0.039 0.330 0.387
.RSpan2 (RS1~) 0.571 0.191 2.985 0.003 0.571 0.491
.SSpan2 (SS1~) 0.330 0.160 2.061 0.039 0.330 0.344
R-Square:
Estimate
post.wm 1.000
dCOG1 0.029
RSpan1 0.477
SSpan1 0.613
RSpan2 0.509
SSpan2 0.656
Group 2 [2]:
Latent Variables:
Estimate Std.Err z-value P(>|z|) Std.lv Std.all
pre.wm =~
RSpan1 1.000 0.719 0.706
SSpan1 1.000 0.719 0.700
post.wm =~
RSpan2 1.000 0.493 0.522
SSpan2 1.436 0.421 3.407 0.001 0.708 0.775
dCOG1 =~
post.wm 1.000 NaN NaN
Regressions:
Estimate Std.Err z-value P(>|z|) Std.lv Std.all
post.wm ~
pre.wm 1.000 1.459 1.459
dCOG1 ~
pre.wm -0.264 0.216 -1.226 0.220 NaN NaN
Covariances:
Estimate Std.Err z-value P(>|z|) Std.lv Std.all
.RSpan1 ~~
.RSpan2 0.039 0.116 0.333 0.739 0.039 0.067
.SSpan1 ~~
.SSpan2 -0.003 0.098 -0.028 0.978 -0.003 -0.007
Intercepts:
Estimate Std.Err z-value P(>|z|) Std.lv Std.all
.post.wm 0.000 0.000 0.000
.dCOG1 -0.086 0.102 -0.846 0.398 NaN NaN
pre.wm 0.128 0.117 1.096 0.273 0.178 0.178
.RSpan1 0.000 0.000 0.000
.SSpan1 0.024 0.118 0.202 0.840 0.024 0.023
.RSpan2 0.000 0.000 0.000
.SSpan2 -0.020 0.145 -0.135 0.893 -0.020 -0.021
Variances:
Estimate Std.Err z-value P(>|z|) Std.lv Std.all
.post.wm 0.000 0.000 0.000
.dCOG1 -0.037 0.075 -0.495 0.621 NaN NaN
pre.wm 0.518 0.133 3.895 0.000 1.000 1.000
.RSpan1 0.520 0.158 3.289 0.001 0.520 0.501
.SSpan1 0.538 0.129 4.167 0.000 0.538 0.509
.RSpan2 0.650 0.132 4.924 0.000 0.650 0.728
.SSpan2 0.334 0.150 2.229 0.026 0.334 0.400
R-Square:
Estimate
post.wm 1.000
dCOG1 NaN
RSpan1 0.499
SSpan1 0.491
RSpan2 0.272
SSpan2 0.600
Group 3 [5]:
Latent Variables:
Estimate Std.Err z-value P(>|z|) Std.lv Std.all
pre.wm =~
RSpan1 1.000 0.693 0.709
SSpan1 1.000 0.693 0.683
post.wm =~
RSpan2 1.000 0.502 0.576
SSpan2 1.494 0.619 2.414 0.016 0.750 0.699
dCOG1 =~
post.wm 1.000 0.521 0.521
Regressions:
Estimate Std.Err z-value P(>|z|) Std.lv Std.all
post.wm ~
pre.wm 1.000 1.380 1.380
dCOG1 ~
pre.wm -0.309 0.196 -1.576 0.115 -0.818 -0.818
Covariances:
Estimate Std.Err z-value P(>|z|) Std.lv Std.all
.RSpan1 ~~
.RSpan2 0.023 0.165 0.136 0.892 0.023 0.046
.SSpan1 ~~
.SSpan2 0.142 0.167 0.851 0.394 0.142 0.249
Intercepts:
Estimate Std.Err z-value P(>|z|) Std.lv Std.all
.post.wm 0.000 0.000 0.000
.dCOG1 -0.149 0.103 -1.448 0.148 -0.567 -0.567
pre.wm -0.067 0.098 -0.686 0.493 -0.097 -0.097
.RSpan1 0.000 0.000 0.000
.SSpan1 -0.092 0.102 -0.902 0.367 -0.092 -0.090
.RSpan2 0.000 0.000 0.000
.SSpan2 0.095 0.201 0.473 0.636 0.095 0.088
Variances:
Estimate Std.Err z-value P(>|z|) Std.lv Std.all
.post.wm 0.000 0.000 0.000
.dCOG1 0.023 0.075 0.304 0.761 0.331 0.331
pre.wm 0.480 0.110 4.384 0.000 1.000 1.000
.RSpan1 0.475 0.139 3.414 0.001 0.475 0.497
.SSpan1 0.550 0.095 5.762 0.000 0.550 0.534
.RSpan2 0.507 0.159 3.197 0.001 0.507 0.668
.SSpan2 0.590 0.284 2.078 0.038 0.590 0.512
R-Square:
Estimate
post.wm 1.000
dCOG1 0.669
RSpan1 0.503
SSpan1 0.466
RSpan2 0.332
SSpan2 0.488