SEM message warning: variances are negative

176 views
Skip to first unread message

Gouvidé Jean GBAGUIDI

unread,
Feb 13, 2023, 12:54:54 PM2/13/23
to lavaan
Hello, I'm running SEM to assess the causality effect of climatic variables on the incidence of malaria.
I developed two different SEM models:
Mod<-'F1=~Rainfall+Mean_Relative.Humidity
+Max_Relative.Humidity
F2=~Mean_Temperature+Max_Temperature
Malaria_Incidence~F1+F2
F1~~F2
'
Mod2<-'F1=~Rainfall+Mean_Relative.Humidity+Mean_Temperature
Malaria_Incidence~F1
F1~~F1
'
When I run the first model, I got the warning message:
mod.1 <- sem(Mod, data=Mal1,fixed.x = T,estimator = "WLSM")
Warning message:
    In lav_object_post_check(object) :
    lavaan WARNING: some estimated ov variances are negative.
But I run the second model without any warning and error message.

Summary of Mod1
summary(mod.1, stand=TRUE,fit.measures=TRUE,rsq=TRUE)
lavaan 0.6.14 ended normally after 35 iterations

Estimator                                       DWLS
Optimization method                           NLMINB
Number of model parameters                        14

Number of observations                          1193

Model Test User Model:
    Standard      Scaled
Test Statistic                                96.884     554.531
Degrees of freedom                                 7           7
P-value (Chi-square)                           0.000       0.000
Scaling correction factor                                  0.175
Satorra-Bentler correction                                    

Model Test Baseline Model:
   
    Test statistic                              8079.332    8079.332
Degrees of freedom                                15          15
P-value                                        0.000       0.000
Scaling correction factor                                  1.000

User Model versus Baseline Model:
   
    Comparative Fit Index (CFI)                    0.989       0.932
Tucker-Lewis Index (TLI)                       0.976       0.855

Robust Comparative Fit Index (CFI)                         0.988
Robust Tucker-Lewis Index (TLI)                            0.975

Root Mean Square Error of Approximation:
   
    RMSEA                                          0.104       0.256
90 Percent confidence interval - lower         0.086       0.214
90 Percent confidence interval - upper         0.123       0.301
P-value H_0: RMSEA <= 0.050                    0.000       0.000
P-value H_0: RMSEA >= 0.080                    0.985       1.000

Robust RMSEA                                               0.107
90 Percent confidence interval - lower                     0.100
90 Percent confidence interval - upper                     0.115
P-value H_0: Robust RMSEA <= 0.050                         0.000
P-value H_0: Robust RMSEA >= 0.080                         1.000

Standardized Root Mean Square Residual:
   
    SRMR                                           0.060       0.060

Parameter Estimates:
   
    Standard errors                           Robust.sem
Information                                 Expected
Information saturated (h1) model        Unstructured

Latent Variables:
    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
F1 =~                                                                
    Rainfall          1.000                               0.837    0.837
Men_Rltv.Hmdty    1.134    0.032   35.436    0.000    0.949    0.949
Max_Rltv.Hmdty    1.015    0.033   30.866    0.000    0.849    0.849
F2 =~                                                                
    Mean_Temperatr    1.000                               0.597    0.597
Max_Temperatur    2.129    0.115   18.527    0.000    1.271    1.271

Regressions:
    Estimate  Std.Err  z-value  P(>|z|)   Std.lv
Malaria_Incidence ~                                            
    F1                   0.243    0.049    5.009    0.000    0.204
F2                  -0.269    0.049   -5.476    0.000   -0.160
Std.all

0.204
-0.160

Covariances:
    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
F1 ~~                                                                
    F2               -0.313    0.024  -12.926    0.000   -0.627   -0.627

Variances:
    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
.Rainfall          0.299    0.021   14.000    0.000    0.299    0.299
.Men_Rltv.Hmdty    0.099    0.009   10.579    0.000    0.099    0.099
.Max_Rltv.Hmdty    0.278    0.014   19.683    0.000    0.278    0.278
.Mean_Temperatr    0.644    0.032   20.381    0.000    0.644    0.644
.Max_Temperatur   -0.616    0.065   -9.447    0.000   -0.616   -0.616
.Malaria_Incdnc    0.892    0.087   10.213    0.000    0.892    0.892
F1                0.701    0.034   20.748    0.000    1.000    1.000
F2                0.356    0.030   11.706    0.000    1.000    1.000

R-Square:
    Estimate
Rainfall          0.701
Men_Rltv.Hmdty    0.901
Max_Rltv.Hmdty    0.722
Mean_Temperatr    0.356
Max_Temperatur       NA
Malaria_Incdnc    0.108


Summary of Mod2:

summary(mod.1, stand=TRUE,fit.measures=TRUE,rsq=TRUE)
lavaan 0.6.14 ended normally after 21 iterations

Estimator                                       DWLS
Optimization method                           NLMINB
Number of model parameters                         8

Number of observations                          1193

Model Test User Model:
    Standard      Scaled
Test Statistic                                53.234      96.080
Degrees of freedom                                 2           2
P-value (Chi-square)                           0.000       0.000
Scaling correction factor                                  0.554
Satorra-Bentler correction                                    

Model Test Baseline Model:
   
    Test statistic                              1782.303    1782.303
Degrees of freedom                                 6           6
P-value                                        0.000       0.000
Scaling correction factor                                  1.000

User Model versus Baseline Model:
   
    Comparative Fit Index (CFI)                    0.971       0.947
Tucker-Lewis Index (TLI)                       0.913       0.841

Robust Comparative Fit Index (CFI)                         0.971
Robust Tucker-Lewis Index (TLI)                            0.912

Root Mean Square Error of Approximation:
   
    RMSEA                                          0.147       0.199
90 Percent confidence interval - lower         0.114       0.155
90 Percent confidence interval - upper         0.182       0.246
P-value H_0: RMSEA <= 0.050                    0.000       0.000
P-value H_0: RMSEA >= 0.080                    1.000       1.000

Robust RMSEA                                               0.148
90 Percent confidence interval - lower                     0.123
90 Percent confidence interval - upper                     0.174
P-value H_0: Robust RMSEA <= 0.050                         0.000
P-value H_0: Robust RMSEA >= 0.080                         1.000

Standardized Root Mean Square Residual:
   
    SRMR                                           0.061       0.061

Parameter Estimates:
   
    Standard errors                           Robust.sem
Information                                 Expected
Information saturated (h1) model        Unstructured

Latent Variables:
    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
F1 =~                                                                
    Rainfall          1.000                               0.876    0.876
Men_Rltv.Hmdty    0.963    0.039   24.574    0.000    0.844    0.844
Mean_Temperatr   -0.496    0.033  -14.803    0.000   -0.434   -0.434

Regressions:
    Estimate  Std.Err  z-value  P(>|z|)   Std.lv
Malaria_Incidence ~                                            
    F1                   0.381    0.035   10.846    0.000    0.334
Std.all

0.334

Variances:
    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
F1                0.768    0.044   17.307    0.000    1.000    1.000
.Rainfall          0.232    0.032    7.236    0.000    0.232    0.232
.Men_Rltv.Hmdty    0.288    0.029   10.092    0.000    0.288    0.288
.Mean_Temperatr    0.811    0.034   24.071    0.000    0.811    0.811
.Malaria_Incdnc    0.888    0.088   10.119    0.000    0.888    0.888

R-Square:
    Estimate
Rainfall          0.768
Men_Rltv.Hmdty    0.712
Mean_Temperatr    0.189
Malaria_Incdnc    0.112

I would like to know if the two models are valid. Could I use the mod one with warning message?

Any comment is welcome to help me.


christop...@gmail.com

unread,
Feb 20, 2023, 3:46:25 PM2/20/23
to lavaan
Seems this post has been unanswered for a week now... You deserve an answer!

- I would like to know if the two models are valid. Could I use the mod one with warning message?

You can look up negative error variance. It is not an admissible solution (variances cannot be negative; how could variation be negative...). Unfortunately, reading output in google groups is not easy unless you use a monospace font (like courier). 

Your fist model results in a negative error variance for Max_Temperatur, this item is not included in your second model. A negative error variance might come from an item being a particularly strong indicator of a latent variable, but your point estimate is quite strong (and negative). Other causes of negative error variance include low sample size (not in your case) and using too few indicators of a latent variable (not in your case). 

I think you should work further with your models. In addition to the negative error variance, both models have too low fit. I suggest reading on negative error variance (also referred to as Heywood cases) and model fit, and how to develop latent variables. 

    RMSEA                                          0.104       0.256 LOW FIT

Gouvidé Jean GBAGUIDI

unread,
Feb 20, 2023, 3:59:55 PM2/20/23
to lav...@googlegroups.com
Thank you so much for the help. I solved this issue of negative variance. and now my model is quite good
> summary(mod.1, stand=TRUE,fit.measures=TRUE,rsq=TRUE)
lavaan 0.6.14 ended normally after 42 iterations


  Estimator                                       DWLS
  Optimization method                           NLMINB
  Number of model parameters                        16

  Number of observations                           284


Model Test User Model:
                                              Standard      Scaled
  Test Statistic                                 7.885      53.822
  Degrees of freedom                                 5           5
  P-value (Chi-square)                           0.163       0.000
  Scaling correction factor                                  0.152
  Shift parameter                                            1.825
    simple second-order correction                                

Model Test Baseline Model:

  Test statistic                              2502.829    1271.793

  Degrees of freedom                                15          15
  P-value                                        0.000       0.000
  Scaling correction factor                                  1.980


User Model versus Baseline Model:

  Comparative Fit Index (CFI)                    0.999       0.961
  Tucker-Lewis Index (TLI)                       0.997       0.883
                                                                 
  Robust Comparative Fit Index (CFI)                         0.999
  Robust Tucker-Lewis Index (TLI)                            0.997


Root Mean Square Error of Approximation:

  RMSEA                                          0.045       0.186
  90 Percent confidence interval - lower         0.000       0.143
  90 Percent confidence interval - upper         0.102       0.232
  P-value H_0: RMSEA <= 0.050                    0.482       0.000
  P-value H_0: RMSEA >= 0.080                    0.183       1.000
                                                                 
  Robust RMSEA                                               0.072
  90 Percent confidence interval - lower                     0.056
  90 Percent confidence interval - upper                     0.090
  P-value H_0: Robust RMSEA <= 0.050                         0.015
  P-value H_0: Robust RMSEA >= 0.080                         0.255


Standardized Root Mean Square Residual:

  SRMR                                           0.031       0.031


Parameter Estimates:

  Standard errors                           Robust.sem
  Information                                 Expected
  Information saturated (h1) model        Unstructured

Latent Variables:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  F1 =~                                                                
    Rainfall          0.965    0.046   20.847    0.000    0.965    0.965
    Men_Rltv.Hmdty    0.910    0.027   33.655    0.000    0.910    0.910
    Max_Rltv.Hmdty    0.693    0.039   17.883    0.000    0.693    0.693
  F2 =~                                                                
    Mean_Temperatr    0.636    0.028   22.682    0.000    0.636    0.636
    Max_Temperatur    0.870                               0.870    0.870

Regressions:
                      Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  Malaria_Incidence ~                                                      
    F1                  -1.515    1.515   -1.000    0.317   -1.515   -1.515
    F2                  -2.003    1.515   -1.322    0.186   -2.003   -2.003


Covariances:
                            Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
 .Mean_Relative.Humidity ~~                                                      
   .Max_Rltv.Hmdty             0.337    0.035    9.518    0.000    0.337    1.126
 .Rainfall ~~                                                                    
   .Men_Rltv.Hmdty            -0.102    0.022   -4.562    0.000   -0.102   -0.930
 .Mean_Temperature ~~                                                            
   .Max_Temperatur             0.389    0.043    9.050    0.000    0.389    1.023
  F1 ~~                                                                          
    F2                        -0.952    0.041  -23.032    0.000   -0.952   -0.952


Variances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .Rainfall          0.070    0.062    1.122    0.262    0.070    0.070
   .Men_Rltv.Hmdty    0.172    0.026    6.532    0.000    0.172    0.172
   .Max_Rltv.Hmdty    0.520    0.053    9.784    0.000    0.520    0.520
   .Mean_Temperatr    0.596    0.050   11.851    0.000    0.596    0.596
   .Max_Temperatur    0.243    0.050    4.851    0.000    0.243    0.243
   .Malaria_Incdnc    0.468    0.282    1.662    0.097    0.468    0.468
    F1                1.000                               1.000    1.000
    F2                1.000                               1.000    1.000

R-Square:
                   Estimate
    Rainfall          0.930
    Men_Rltv.Hmdty    0.828
    Max_Rltv.Hmdty    0.480
    Mean_Temperatr    0.404
    Max_Temperatur    0.757
    Malaria_Incdnc    0.532

--
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/1B1kc5wiyGI/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/afc5010c-06f1-4669-a9bb-c21921244ec2n%40googlegroups.com.


--
Gouvidé Jean GBAGUIDI
WASCAL PhD-Candidate
Climate Change and Disaster Risks Management
MSc Ecohydrologist
MSc: Natural Sciences
Secretary of Benin Jeunesse Elite NGO
Benin National Focal Point: United International Federation 
of Youth for Water and Climate(UN1FY)
E-mail: gouvid...@gmail.com/gbaguid...@yahoo.fr
Phone:(00229)96258002/95036686  (Benin)
(00228)93649692 (Togo-LOME)
Phillipians: 4:13: "I can do all things through him who gives"

Jošt Bartol

unread,
Feb 22, 2023, 2:24:13 AM2/22/23
to lav...@googlegroups.com
Dear Gouvidé,

I checked your solution, and I have noted several issues that you might want to address in in improving your model:
1. As much as I see, you introduced covariances among items measuring F1 and F2. While this might be theoretically appropriate, I observed that correlations among these items (std. covariances) are larger than 1. This indicates problems.
2. I see that the error variances of the two items (Rainfall and Malaria_Incdience) is not statistically significant. While this might not necessarily be a reason for alarm, it is worth checking out. See Brown's 2015 book Confirmatory factor analysis for applied research page 114.
3. The F1 and F2 factors do NOT have a statistically significant influence on Malaria Incidence + this effect is very very different than the effect of your model 1 (which I think is the most reasonable model).
Based on these considerations, I would not trust your proposed solution.

Now, I do not know the conceptual underpinnings for the model and the need for two factors, however, could not the same aim be achieved by running OLS regression analysis with the items in factors F1 and F2 predicting malaria incidence? In this case, you might want to remove redundant items to avoid multicollinearity (e.g., by using principal components analysis to select the items that best represent each of your two factors; see Hair et al., Multivariate data analysis). It seems to me that the reason your model has problems is because the items in each factor are measuring almost the same thing (i.e., in F1 all measure some form of humidity, in F2 all measure some form of temperature).

Hope this helps,
Jošt



V V pon., 20. feb. 2023 ob 21:59 je oseba Gouvidé Jean GBAGUIDI <gouvid...@gmail.com> napisala:
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/CAPjjv4jeg5PVOMNTWb4_BNb2SGzWx%3DJ10opK6%3D4i5zYUg3du-Q%40mail.gmail.com.

Gouvidé Jean GBAGUIDI

unread,
Feb 22, 2023, 4:22:29 AM2/22/23
to lav...@googlegroups.com
Thank you for the comment and the suggestion. I will check all the issues to perform the model. My best regards

Reply all
Reply to author
Forward
0 new messages