SEM with categorical, non-normal variables and missing data - which estimator to use?

1,172 views
Skip to first unread message

Sin Ching See

unread,
Mar 9, 2019, 1:14:09 AM3/9/19
to lavaan

Hi all,


I am trying to run SEM on my dataset (n = 501). There are several issues with my data so the default ML doesn't seem to be an appropriate estimator:


1. My data is mostly categorical and non-normal. In the diagram below, I have indicated the nature of each of my variable (in red). Also, for my final outcome variable (currentbehav), it is a latent variable made up of an ordered variable (Freq of visit) and a binary variable (Fav activity), which I makes me wonder what the nature of the final outcome variable is. 


Screen Shot 2019-03-09 at 10.26.02 AM.png
















2. I have missing data in several of my variables, a large proportion of it comes from the variable HHincomeperpersonK (household income per person) and favourite activity - young and now. I have checked my missing data, and it is unlikely to be missing completely at random (MCAR), so I think I should use FIML for the model. 


I specified the model as follows and ran a SEM on it. 


VBNfullmodel <-'

#measurement model 

socioecon =~ Gender + Age + Nationality + Ethnicity + Religion + Relationship + HHincomeperpersonK + Housing_type

personality =~ Extraverted_Enthusiastic + Critical_quarrelsome + Dependable_Selfdiscipline + Anxious_easilyupset + Opentonewex_complex + Reserved_quiet + Sympathetic_warm + Disorganised_careless + Calm_emotionallystable + Conventional_uncreative

NEP=~ Limit + Modify + Interfere + Ingenuity + Abuse + NatRes + Rights + Industrial + Laws + Crisis + Spaceship + Rule + Balance + Learn + Eco_crsis

pastexposure =~ Act_after_school_outdoors + Freq_of_visit_young + Fav_activity_Young  + Childhood_memory 

currentbehav =~ 1*Freq_of_visit_now + 1*Fav_acitivity_Now


#regression 

currentbehav ~ NEP 

NEP ~ Instrumental + Relational + Intrinsic 

Instrumental ~ personality + pastexposure 

Relational ~ personality + pastexposure 

Intrinsic ~ personality + pastexposure 

personality ~ socioecon + pastexposure

pastexposure ~ socioecon

'


The code runs fine with no warning messages using ML as an estimator. However, I think the estimates produced using ML are unlikely to be reliable given that my final outcome variable (currentbehav) is not normal or continuous. After reading  some threads from this google group and some SEM textbooks and guides, I decide to use MLR as an estimation method since I have missing data and MLR seems to be able to deal with it using FIML.  However, when I changed the estimator to MLR, many warning messages were produced. 


fit7 <- sem(VBNfullmodel, data = fulldata, orthogonal = TRUE, "MLR")


warning message MLF MLR.png














I am not sure if MLR is the appropriate estimation method in my case. I checked several model fit indices and found that the model using MLR has better fit index than the model using ML (although i'm not sure if i'm suppose to compare it this way) I am also thinking if my model is too complex, and if I should try to simplify it a little. 


I will greatly appreciate any advice/comment. Thank you in advance! 

Sin Ching See

unread,
Mar 9, 2019, 8:56:55 AM3/9/19
to lavaan
fit5 <- sem(VBNfullmodel, data = fulldata, orthogonal = TRUE)
summary(fit5, standardized = TRUE, fit.measures = TRUE)

lavaan 0.6-3 ended normally after 180 iterations

  Optimization method                           NLMINB
  Number of free parameters                         96

                                                  Used       Total
  Number of observations                           280         501

  Estimator                                         ML
  Model Fit Test Statistic                    1997.188
  Degrees of freedom                               850
  P-value (Chi-square)                           0.000

Model test baseline model:

  Minimum Function Test Statistic             3222.475
  Degrees of freedom                               903
  P-value                                        0.000

User model versus baseline model:

  Comparative Fit Index (CFI)                    0.505
  Tucker-Lewis Index (TLI)                       0.475

Loglikelihood and Information Criteria:

  Loglikelihood user model (H0)             -15062.540
  Loglikelihood unrestricted model (H1)     -14063.946

  Number of free parameters                         96
  Akaike (AIC)                               30317.080
  Bayesian (BIC)                             30666.020
  Sample-size adjusted Bayesian (BIC)        30361.610

Root Mean Square Error of Approximation:

  RMSEA                                          0.069
  90 Percent Confidence Interval          0.065  0.073
  P-value RMSEA <= 0.05                          0.000

Standardized Root Mean Square Residual:

  SRMR                                           0.088

Parameter Estimates:

  Information                                 Expected
  Information saturated (h1) model          Structured
  Standard Errors                             Standard

Latent Variables:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  socioecon =~                                                          
    Male              1.000                               0.443    0.886
    Age               2.829    1.193    2.372    0.018    1.252    0.530
    Singaporean       0.033    0.042    0.771    0.441    0.014    0.054
    Chinese           0.089    0.051    1.737    0.082    0.039    0.150
    Hokkien           0.082    0.080    1.018    0.308    0.036    0.073
    NoReligion        0.116    0.084    1.384    0.166    0.052    0.107
    Single           -0.057    0.068   -0.844    0.399   -0.025   -0.059
    HHincomprprsnK    0.172    0.243    0.707    0.480    0.076    0.049
    Housing_type     -0.116    0.479   -0.241    0.809   -0.051   -0.016
  personality =~                                                        
    Extrvrtd_Enths    1.000                               0.634    0.385
    Criticl_qrrlsm   -0.402    0.194   -2.076    0.038   -0.255   -0.156
    Dpndbl_Slfdscp    0.718    0.182    3.947    0.000    0.455    0.363
    Anxious_slypst   -0.498    0.198   -2.520    0.012   -0.316   -0.195
    Opentnwx_cmplx    0.691    0.175    3.943    0.000    0.438    0.362
    Reserved_quiet   -0.843    0.228   -3.703    0.000   -0.534   -0.327
    Sympathetc_wrm    0.520    0.155    3.344    0.001    0.329    0.281
    Disrgnsd_crlss   -0.440    0.201   -2.194    0.028   -0.279   -0.166
    Clm_mtnllystbl    0.670    0.191    3.500    0.000    0.424    0.300
    Convntnl_ncrtv   -0.342    0.167   -2.053    0.040   -0.217   -0.154
  NEP =~                                                                
    Limit             1.000                               0.401    0.432
    Modify           -0.243    0.190   -1.279    0.201   -0.097   -0.086
    Interfere         0.948    0.202    4.684    0.000    0.380    0.383
    Ingenuity        -0.186    0.188   -0.989    0.323   -0.074   -0.066
    Abuse             1.296    0.202    6.408    0.000    0.520    0.719
    NatRes            0.231    0.176    1.311    0.190    0.093    0.088
    Rights            0.911    0.193    4.728    0.000    0.365    0.388
    Industrial       -0.802    0.237   -3.385    0.001   -0.322   -0.247
    Laws              0.851    0.162    5.270    0.000    0.341    0.464
    Crisis           -0.684    0.217   -3.156    0.002   -0.274   -0.228
    Spaceship         1.130    0.203    5.571    0.000    0.453    0.514
    Rule             -0.496    0.226   -2.195    0.028   -0.199   -0.151
    Balance           0.828    0.171    4.840    0.000    0.332    0.402
    Learn            -0.213    0.183   -1.163    0.245   -0.085   -0.078
    Eco_crsis         1.443    0.220    6.555    0.000    0.579    0.789
  pastexposure =~                                                       
    Frq_f_vst_ynCK    1.000                               0.478    0.443
    Act_ftr_schl_t    0.524    0.104    5.019    0.000    0.251    0.553
    NtrApprctn_Yng   -0.028    0.049   -0.572    0.567   -0.013   -0.042
    Childhood_mmry    1.198    0.241    4.977    0.000    0.573    0.541
  currentbehav =~                                                       
    NatrApprctn_Nw    1.000                               0.096    0.250
    Frq_f_vst_nwCK   -0.674    0.794   -0.849    0.396   -0.065   -0.109

Regressions:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  currentbehav ~                                                        
    NEP               0.134    0.066    2.039    0.041    0.559    0.559
  NEP ~                                                                 
    Instrumental     -0.093    0.105   -0.891    0.373   -0.233   -0.109
    Relational        0.015    0.083    0.177    0.860    0.037    0.020
    Intrinsic         0.198    0.079    2.498    0.013    0.494    0.252
  Instrumental ~                                                        
    personality       3.464    1.741    1.989    0.047    2.195    4.712
    pastexposure     -4.193    2.363   -1.775    0.076   -2.006   -4.307
  Relational ~                                                          
    personality       3.488    1.746    1.997    0.046    2.210    4.161
    pastexposure     -4.167    2.367   -1.760    0.078   -1.994   -3.754
  Intrinsic ~                                                           
    personality       3.134    1.589    1.972    0.049    1.986    3.892
    pastexposure     -3.848    2.159   -1.782    0.075   -1.841   -3.609
  personality ~                                                         
    socioecon         0.013    0.022    0.613    0.540    0.009    0.009
    pastexposure      1.299    0.308    4.222    0.000    0.981    0.981
  pastexposure ~                                                        
    socioecon         0.101    0.098    1.036    0.300    0.094    0.094

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .Male              0.054    0.081    0.664    0.507    0.054    0.215
   .Age               4.008    0.731    5.485    0.000    4.008    0.719
   .Singaporean       0.072    0.006   11.823    0.000    0.072    0.997
   .Chinese           0.068    0.006   11.720    0.000    0.068    0.978
   .Hokkien           0.244    0.021   11.814    0.000    0.244    0.995
   .NoReligion        0.230    0.020   11.787    0.000    0.230    0.989
   .Single            0.181    0.015   11.821    0.000    0.181    0.997
   .HHincomprprsnK    2.424    0.205   11.825    0.000    2.424    0.998
   .Housing_type     10.049    0.849   11.831    0.000   10.049    1.000
   .Extrvrtd_Enths    2.311    0.210   10.998    0.000    2.311    0.852
   .Criticl_qrrlsm    2.615    0.223   11.716    0.000    2.615    0.976
   .Dpndbl_Slfdscp    1.368    0.123   11.108    0.000    1.368    0.869
   .Anxious_slypst    2.523    0.217   11.646    0.000    2.523    0.962
   .Opentnwx_cmplx    1.273    0.115   11.111    0.000    1.273    0.869
   .Reserved_quiet    2.385    0.212   11.263    0.000    2.385    0.893
   .Sympathetc_wrm    1.267    0.111   11.427    0.000    1.267    0.921
   .Disrgnsd_crlss    2.758    0.236   11.700    0.000    2.758    0.973
   .Clm_mtnllystbl    1.821    0.160   11.363    0.000    1.821    0.910
   .Convntnl_ncrtv    1.946    0.166   11.719    0.000    1.946    0.976
   .Limit             0.701    0.063   11.201    0.000    0.701    0.813
   .Modify            1.277    0.108   11.812    0.000    1.277    0.993
   .Interfere         0.844    0.074   11.363    0.000    0.844    0.854
   .Ingenuity         1.266    0.107   11.820    0.000    1.266    0.996
   .Abuse             0.253    0.029    8.746    0.000    0.253    0.483
   .NatRes            1.100    0.093   11.811    0.000    1.100    0.992
   .Rights            0.754    0.066   11.347    0.000    0.754    0.849
   .Industrial        1.588    0.136   11.655    0.000    1.588    0.939
   .Laws              0.425    0.038   11.077    0.000    0.425    0.785
   .Crisis            1.380    0.118   11.683    0.000    1.380    0.948
   .Spaceship         0.572    0.053   10.838    0.000    0.572    0.736
   .Rule              1.689    0.144   11.768    0.000    1.689    0.977
   .Balance           0.572    0.051   11.302    0.000    0.572    0.838
   .Learn             1.192    0.101   11.816    0.000    1.192    0.994
   .Eco_crsis         0.203    0.028    7.185    0.000    0.203    0.378
   .Frq_f_vst_ynCK    0.940    0.091   10.365    0.000    0.940    0.804
   .Act_ftr_schl_t    0.143    0.016    9.147    0.000    0.143    0.694
   .NtrApprctn_Yng    0.101    0.009   11.822    0.000    0.101    0.998
   .Childhood_mmry    0.796    0.085    9.315    0.000    0.796    0.708
   .NatrApprctn_Nw    0.140    0.025    5.624    0.000    0.140    0.938
   .Frq_f_vst_nwCK    0.354    0.031   11.228    0.000    0.354    0.988
   .Instrumental      0.024    0.008    3.186    0.001    0.024    0.112
   .Relational        0.078    0.010    7.853    0.000    0.078    0.278
   .Intrinsic         0.109    0.011    9.803    0.000    0.109    0.419
    socioecon         0.196    0.083    2.351    0.019    1.000    1.000
   .personality       0.014    0.015    0.967    0.333    0.035    0.035
   .NEP               0.155    0.045    3.425    0.001    0.961    0.961
   .pastexposure      0.227    0.073    3.123    0.002    0.991    0.991
   .currentbehav      0.006    0.022    0.293    0.770    0.687    0.687

Mauricio Garnier-Villarreal

unread,
Mar 9, 2019, 1:06:51 PM3/9/19
to lavaan
If you have ordered categorical data, the best option is to use Diagonal weighted least square estimator (WLSM). Now, the issue with missing data is that since it is not a Maximum likelihood method FIML is not an option. You would need to use Multiple imputations. For this you can use the sem.mi function in the semTools package. I recommned to use the 2 step process, first generate the imputed data sets, for example with the mice package, and then give the imputations to the sem.mi function to do the analysis with the multiple data sets and combine the results with WLSMV

Sin Ching See

unread,
Mar 10, 2019, 11:34:10 AM3/10/19
to lavaan
Thank you for the clear instruction! I have tried using Diagonal weighted least square (which I think is DWLS for sem) and have also used mice for multiple imputations of missing data. However, there are many warning messages produced and I'm not sure what I should do next. The output and warning messages are as follows: 

fit9 <- sem.mi(VBNfullmodel, data= mi_list, estimator ="DWLS", orthogonal = TRUE,
               ordered = c("Freq_of_visit_nowOrd", "Freq_of_visit_youngOrd", "NatureAppreciation_Now", "NatureAppreciation_Young", "Act_after_school_outdoors", "Childhood_memory", 
                           "Extraverted_Enthusiastic", "Critical_quarrelsome", "Dependable_Selfdiscipline", "Anxious_easilyupset", "Opentonewex_complex", "Reserved_quiet", "Sympathetic_warm", "Disorganised_careless", "Calm_emotionallystable", "Conventional_uncreative",
                           "Limit", "Modify", "Interfere", "Ingenuity", "Abuse", "NatRes", "Rights", "Industrial", "Laws", "Crisis", "Spaceship", "Rule", "Balance", "Learn", "Eco_crsis",
                           "Male", "Single", "Housing_type"
))

There were 24 warnings (use warnings() to see them)

> warnings()

 

Warning messages:

1: In lav_model_vcov(lavmodel = lavmodel, lavsamplestats = lavsamplestats,  ... :

  lavaan WARNING:

    Could not compute standard errors! The information matrix could

    not be inverted. This may be a symptom that the model is not

    identified.

2: In lav_object_post_check(object) :

  lavaan WARNING: some estimated ov variances are negative

3: In lav_object_post_check(object) :

  lavaan WARNING: some estimated lv variances are negative

4: In lavaan::lavaan(model = "\n#measurement model \nsocioecon =~ Male + Age + Single + HHincomeperpersonK + Housing_type\npersonality =~ Extraverted_Enthusiastic + Critical_quarrelsome + Dependable_Selfdiscipline + Anxious_easilyupset + Opentonewex_complex + Reserved_quiet + Sympathetic_warm + Disorganised_careless + Calm_emotionallystable + Conventional_uncreative\nNEP=~ Limit + Modify + Interfere + Ingenuity + Abuse + NatRes + Rights + Industrial + Laws + Crisis + Spaceship + Rule + Balance + Learn + Eco_crsis\npastexposure =~ Freq_of_visit_youngOrd + Act_after_school_outdoors + NatureAppreciation_Young  + Childhood_memory \ncurrentbehav =~ NatureAppreciation_Now + Freq_of_visit_nowOrd\n\n#regression \ncurrentbehav ~ NEP \nNEP ~ Instrumental + Relational + Intrinsic \nInstrumental ~ personality + pastexposure \nRelational ~ personality + pastexposure \nIntrinsic ~ personality + pastexposure \npersonality ~ socioecon + pastexposure\npastexposure ~ socioecon\n",  ... :

  lavaan WARNING: not all elements of the gradient are (near) zero;

                  the optimizer may not have found a local solution;

                  use lavInspect(fit, "optim.gradient") to investigate

5: In lav_model_vcov(lavmodel = lavmodel, lavsamplestats = lavsamplestats,  ... :

  lavaan WARNING:

    Could not compute standard errors! The information matrix could

    not be inverted. This may be a symptom that the model is not

    identified.

6: In lav_object_post_check(object) :

  lavaan WARNING: some estimated ov variances are negative

7: In lav_object_post_check(object) :

  lavaan WARNING: some estimated lv variances are negative

8: In lavaan(slotOptions = structure(list(model.type = "sem",  ... :

  lavaan WARNING: not all elements of the gradient are (near) zero;

                  the optimizer may not have found a local solution;

                  use lavInspect(fit, "optim.gradient") to investigate

9: In lav_model_vcov(lavmodel = lavmodel, lavsamplestats = lavsamplestats,  ... :

  lavaan WARNING:

    Could not compute standard errors! The information matrix could

    not be inverted. This may be a symptom that the model is not

    identified.

10: In lav_object_post_check(object) :

  lavaan WARNING: some estimated ov variances are negative

11: In lav_object_post_check(object) :

  lavaan WARNING: some estimated lv variances are negative

12: In lavaan(slotOptions = structure(list(model.type = "sem",  ... :

  lavaan WARNING: not all elements of the gradient are (near) zero;

                  the optimizer may not have found a local solution;

                  use lavInspect(fit, "optim.gradient") to investigate

13: In lav_model_vcov(lavmodel = lavmodel, lavsamplestats = lavsamplestats,  ... :

  lavaan WARNING:

    Could not compute standard errors! The information matrix could

    not be inverted. This may be a symptom that the model is not

    identified.

14: In lav_object_post_check(object) :

  lavaan WARNING: some estimated ov variances are negative

15: In lav_object_post_check(object) :

  lavaan WARNING: some estimated lv variances are negative

16: In lavaan(slotOptions = structure(list(model.type = "sem",  ... :

  lavaan WARNING: not all elements of the gradient are (near) zero;

                  the optimizer may not have found a local solution;

                  use lavInspect(fit, "optim.gradient") to investigate

17: In lav_object_post_check(object) :

  lavaan WARNING: some estimated lv variances are negative

18: In sqrt(ETA2) : NaNs produced

19: In sqrt(ETA2) : NaNs produced

20: In sqrt(ETA2) : NaNs produced

21: In lav_model_vcov(lavmodel = lavmodel, lavsamplestats = lavsamplestats,  ... :

  lavaan WARNING:

    Could not compute standard errors! The information matrix could

    not be inverted. This may be a symptom that the model is not

    identified.

22: In lav_object_post_check(object) :

  lavaan WARNING: some estimated ov variances are negative

23: In lav_object_post_check(object) :

  lavaan WARNING: some estimated lv variances are negative

24: In lavaan(slotOptions = structure(list(model.type = "sem",  ... :

  lavaan WARNING: not all elements of the gradient are (near) zero;

                  the optimizer may not have found a local solution;

                  use lavInspect(fit, "optim.gradient") to investigate


summary(fit9)

Convergence information:

The model converged on 5 imputed data sets

 

Standard errors could not be computed for data set(s) 1, 2, 3, 5

Try fitting the model to the individual data set(s) to diagnose problems. If they cannot be fixed, try inspecting the imputations. It may be necessary to reimpute the data with some restrictions imposed.

 

Heywood cases detected for data set(s) 1, 2, 3, 5

These are not necessarily a cause for concern, unless a pooled estimate is also a Heywood case.

 

Rubin's (1987) rules were used to pool point and SE estimates across 5 imputed data sets, and to calculate degrees of freedom for each parameter's t test and CI.

 

Parameter Estimates:

 

  Information                                 Expected

  Information saturated (h1) model        Unstructured

  Standard Errors                             Standard

 

Latent Variables:

                   Estimate  Std.Err  t-value       df  P(>|t|)

  socioecon =~                                                

    Male              1.000                                   

    Age             -76.581  329.209   -0.233 NA             NA

    Single           -0.050   14.970   -0.003 NA             NA

    HHincomprprsnK   -0.056   14.907   -0.004 NA             NA

    Housing_type      0.012    8.383    0.001 NA             NA

  personality =~                                              

    Extrvrtd_Enths    1.000                                   

    Criticl_qrrlsm   -0.224   12.788   -0.017 NA             NA

    Dpndbl_Slfdscp    0.902   18.849    0.048 NA             NA

    Anxious_slypst   -0.583   15.102   -0.039 NA             NA

    Opentnwx_cmplx    0.704   16.742    0.042 NA             NA

    Reserved_quiet   -0.676   16.591   -0.041 NA             NA

    Sympathetc_wrm    0.679   16.116    0.042 NA             NA

    Disrgnsd_crlss   -0.623   15.382   -0.040 NA             NA

    Clm_mtnllystbl    0.732   16.293    0.045 NA             NA

    Convntnl_ncrtv   -0.229   13.001   -0.018 NA             NA

  NEP =~                                                      

    Limit             1.000                                   

    Modify           -0.688   14.088   -0.049 NA             NA

    Interfere         0.891   15.369    0.058 NA             NA

    Ingenuity        -0.690   13.512   -0.051 NA             NA

    Abuse             1.414   19.562    0.072 NA             NA

    NatRes           -0.111   11.328   -0.010 NA             NA

    Rights            0.907   15.603    0.058 NA             NA

    Industrial       -1.060   16.042   -0.066 NA             NA

    Laws              0.954   15.641    0.061 NA             NA

    Crisis           -1.202   17.186   -0.070 NA             NA

    Spaceship         0.831   14.965    0.056 NA             NA

    Rule             -0.852   14.985   -0.057 NA             NA

    Balance           0.792   14.606    0.054 NA             NA

    Learn            -0.717   13.498   -0.053 NA             NA

    Eco_crsis         1.531   21.218    0.072 NA             NA

  pastexposure =~                                             

    Frq_f_vst_yngO    1.000                                   

    Act_ftr_schl_t    1.218   27.356    0.045 NA             NA

    NtrApprctn_Yng   -0.258   23.408   -0.011 NA             NA

    Childhood_mmry    1.052   22.516    0.047 NA             NA

  currentbehav =~                                             

    NatrApprctn_Nw    1.000                                   

    Frq_f_vst_nwOr    0.400   31.514    0.013 NA             NA

 

Regressions:

                   Estimate  Std.Err  t-value       df  P(>|t|)

  currentbehav ~                                               

    NEP               0.403   18.462    0.022 NA             NA

  NEP ~                                                       

    Instrumental   -347.255   48.513   -7.158 NA             NA

    Relational      320.378   26.176   12.239 NA             NA

    Intrinsic        -0.658   33.511   -0.020 NA             NA

  Instrumental ~                                              

    personality      -4.797  195.095   -0.025 NA             NA

    pastexposure      6.307  220.417    0.029 NA             NA

  Relational ~                                                

    personality      -5.134  195.332   -0.026 NA             NA

    pastexposure      6.769  221.153    0.031 NA             NA

  Intrinsic ~                                                 

    personality      -4.646  215.469   -0.022 NA             NA

    pastexposure      6.022  243.228    0.025 NA             NA

  personality ~                                               

    socioecon         0.008    1.093    0.007 NA             NA

    pastexposure      1.186   24.030    0.049 NA             NA

  pastexposure ~                                              

    socioecon         0.030    2.828    0.010 NA             NA

 

Intercepts:

                   Estimate  Std.Err  t-value       df  P(>|t|)

   .Male              0.000                                   

   .Age              21.294   30.361    0.701 NA             NA

   .Single            0.000                                    

   .HHincomprprsnK    2.118   26.974    0.079 NA             NA

   .Housing_type      0.000                                   

   .Extrvrtd_Enths    0.000                                   

   .Criticl_qrrlsm    0.000                                    

   .Dpndbl_Slfdscp    0.000                                   

   .Anxious_slypst    0.000                                   

   .Opentnwx_cmplx    0.000                                   

   .Reserved_quiet    0.000                                    

   .Sympathetc_wrm    0.000                                   

   .Disrgnsd_crlss    0.000                                   

   .Clm_mtnllystbl    0.000                                   

   .Convntnl_ncrtv    0.000                                    

   .Limit             0.000                                   

   .Modify            0.000                                   

   .Interfere         0.000                                   

   .Ingenuity         0.000                                   

   .Abuse             0.000                                   

   .NatRes            0.000                                   

   .Rights            0.000                                   

   .Industrial        0.000                                   

   .Laws              0.000                                   

   .Crisis            0.000                                   

   .Spaceship         0.000                                   

   .Rule              0.000                                   

   .Balance           0.000                                   

   .Learn             0.000                                   

   .Eco_crsis         0.000                                   

   .Frq_f_vst_yngO    0.000                                   

   .Act_ftr_schl_t    0.000                                   

   .NtrApprctn_Yng    0.000                                   

   .Childhood_mmry    0.000                                   

   .NatrApprctn_Nw    0.000                                   

   .Frq_f_vst_nwOr    0.000                                   

   .Instrumental      3.959    9.471    0.418 NA             NA

   .Relational        3.868   10.055    0.385 NA             NA

   .Intrinsic         4.172   10.493    0.398 NA             NA

    socioecon         0.000                                   

   .personality       0.000                                   

   .NEP               0.000                                   

   .pastexposure      0.000                                   

   .currentbehav      0.000                                   

 

Thresholds:

                   Estimate  Std.Err  t-value       df  P(>|t|)

    Male|t1          -0.065   14.224   -0.005 NA             NA

    Single|t1        -0.865   16.401   -0.053 NA             NA

    Housing_typ|t1   -2.597   51.544   -0.050 NA             NA

    Housing_typ|t2   -1.833   26.250   -0.070 NA             NA

    Housing_typ|t3   -1.782   25.388   -0.070 NA             NA

    Housing_typ|t4   -1.758   25.001   -0.070 NA             NA

    Housing_typ|t5   -0.986   16.889   -0.058 NA             NA

    Housing_typ|t6   -0.960   16.746   -0.057 NA             NA

    Housing_typ|t7   -0.693   15.433   -0.045 NA             NA

    Housing_typ|t8    0.107   14.254    0.007 NA             NA

    Housing_typ|t9    0.826   16.067    0.051 NA             NA

    Housng_typ|t10    0.878   16.322    0.054 NA             NA

    Housng_typ|t11    0.893   16.401    0.054 NA             NA

    Housng_typ|t12    0.902   16.482    0.055 NA             NA

    Extrvrtd_Ent|1   -1.775   26.250   -0.068 NA             NA

    Extrvrtd_Ent|2   -0.734   15.694   -0.047 NA             NA

    Extrvrtd_Ent|3   -0.225   14.343   -0.016 NA             NA

    Extrvrtd_Ent|4    0.053   14.219    0.004 NA             NA

    Extrvrtd_Ent|5    0.627   15.274    0.041 NA             NA

    Extrvrtd_Ent|6    1.775   26.250    0.068 NA             NA

    Crtcl_qrrlsm|1   -1.393   20.553   -0.068 NA             NA

    Crtcl_qrrlsm|2   -0.670   15.433   -0.043 NA             NA

    Crtcl_qrrlsm|3   -0.189   14.304   -0.013 NA             NA

    Crtcl_qrrlsm|4    0.184   14.299    0.013 NA             NA

    Crtcl_qrrlsm|5    1.038   17.375    0.060 NA             NA

    Crtcl_qrrlsm|6    1.912   29.136    0.066 NA             NA

    Dpndbl_Slfds|1   -2.145   35.572   -0.060 NA             NA

    Dpndbl_Slfds|2   -1.608   23.391   -0.069 NA             NA

    Dpndbl_Slfds|3   -1.055   17.496   -0.060 NA             NA

    Dpndbl_Slfds|4   -0.608   15.210   -0.040 NA             NA

    Dpndbl_Slfds|5    0.148   14.269    0.010 NA             NA

    Dpndbl_Slfds|6    1.448   21.198    0.068 NA             NA

    Anxs_slypst|t1   -1.556   22.621   -0.069 NA             NA

    Anxs_slypst|t2   -0.794   15.967   -0.050 NA             NA

    Anxs_slypst|t3   -0.350   14.532   -0.024 NA             NA

    Anxs_slypst|t4    0.018   14.213    0.001 NA             NA

    Anxs_slypst|t5    0.850   16.246    0.052 NA             NA

    Anxs_slypst|t6    1.523   22.168    0.069 NA             NA

    Opntnwx_cmpl|1   -2.879   79.970   -0.036 NA             NA

    Opntnwx_cmpl|2   -2.015   31.714   -0.064 NA             NA

    Opntnwx_cmpl|3   -1.238   18.977   -0.065 NA             NA

    Opntnwx_cmpl|4   -0.682   15.482   -0.044 NA             NA

    Opntnwx_cmpl|5    0.230   14.349    0.016 NA             NA

    Opntnwx_cmpl|6    1.196   18.603    0.064 NA             NA

    Reserved_qt|t1   -1.826   27.255   -0.067 NA             NA

    Reserved_qt|t2   -1.156   18.267   -0.063 NA             NA

    Reserved_qt|t3   -0.708   15.585   -0.045 NA             NA

    Reserved_qt|t4   -0.307   14.459   -0.021 NA             NA

    Reserved_qt|t5    0.376   14.584    0.026 NA             NA

    Reserved_qt|t6    1.318   19.744    0.067 NA             NA

    Sympthtc_wrm|1   -2.327   42.365   -0.055 NA             NA

    Sympthtc_wrm|2   -1.800   26.732   -0.067 NA             NA

    Sympthtc_wrm|3   -1.318   19.744   -0.067 NA             NA

    Sympthtc_wrm|4   -0.754   15.780   -0.048 NA             NA

    Sympthtc_wrm|5    0.033   14.215    0.002 NA             NA

    Sympthtc_wrm|6    1.186   18.516    0.064 NA             NA

    Dsrgnsd_crls|1   -1.448   21.198   -0.068 NA             NA

    Dsrgnsd_crls|2   -0.689   15.507   -0.044 NA             NA

    Dsrgnsd_crls|3   -0.168   14.285   -0.012 NA             NA

    Dsrgnsd_crls|4    0.184   14.299    0.013 NA             NA

    Dsrgnsd_crls|5    0.917   16.610    0.055 NA             NA

    Dsrgnsd_crls|6    1.800   26.732    0.067 NA             NA

    Clm_mtnllyst|1   -2.198   37.360   -0.059 NA             NA

    Clm_mtnllyst|2   -1.507   21.957   -0.069 NA             NA

    Clm_mtnllyst|3   -0.822   16.102   -0.051 NA             NA

    Clm_mtnllyst|4   -0.387   14.606   -0.027 NA             NA

    Clm_mtnllyst|5    0.425   14.689    0.029 NA             NA

    Clm_mtnllyst|6    1.462   21.376    0.068 NA             NA

    Cnvntnl_ncrt|1   -1.707   25.001   -0.068 NA             NA

    Cnvntnl_ncrt|2   -1.004   17.148   -0.059 NA             NA

    Cnvntnl_ncrt|3   -0.403   14.640   -0.028 NA             NA

    Cnvntnl_ncrt|4    0.204   14.320    0.014 NA             NA

    Cnvntnl_ncrt|5    1.064   17.558    0.061 NA             NA

    Cnvntnl_ncrt|6    2.145   35.572    0.060 NA             NA

    Limit|t1       -140.285   36.388   -3.855 NA             NA

    Limit|t2       -139.830   29.494   -4.741 NA             NA

    Limit|t3       -139.164   25.370   -5.485 NA             NA

    Limit|t4       -138.036   24.206   -5.703 NA             NA

    Modify|t1        93.793   25.938    3.616 NA             NA

    Modify|t2        94.852   20.740    4.573 NA             NA

    Modify|t3        95.273   20.441    4.661 NA             NA

    Modify|t4        96.573   24.610    3.924 NA             NA

    Interfere|t1   -125.305   38.394   -3.264 NA             NA

    Interfere|t2   -124.468   26.086   -4.771 NA             NA

    Interfere|t3   -124.016   23.868   -5.196 NA             NA

    Interfere|t4   -122.793   22.971   -5.346 NA             NA

    Ingenuity|t1     94.294   25.122    3.753 NA             NA

    Ingenuity|t2     95.240   20.640    4.614 NA             NA

    Ingenuity|t3     95.855   20.317    4.718 NA             NA

    Ingenuity|t4     96.993   24.368    3.980 NA             NA

    Abuse|t1       -198.013   57.783   -3.427 NA             NA

    Abuse|t2       -197.300   37.372   -5.279 NA             NA

    Abuse|t3       -196.749   32.341   -6.084 NA             NA

    Abuse|t4       -195.377   29.751   -6.567 NA             NA

    NatRes|t1        13.611   27.603    0.493 NA             NA

    NatRes|t2        14.406   19.014    0.758 NA             NA

    NatRes|t3        14.977   16.958    0.883 NA             NA

    NatRes|t4        16.153   17.994    0.898 NA             NA

    Rights|t1      -127.403   37.452   -3.402 NA             NA

    Rights|t2      -126.769   27.593   -4.594 NA             NA

    Rights|t3      -126.370   24.979   -5.059 NA             NA

    Rights|t4      -125.341   22.979   -5.454 NA             NA

    Industrial|t1   145.995   25.448    5.737 NA             NA

    Industrial|t2   146.904   24.650    5.960 NA             NA

    Industrial|t3   147.300   25.139    5.859 NA             NA

    Industrial|t4   148.070   28.428    5.209 NA             NA

    Laws|t1        -134.262   49.717   -2.701 NA             NA

    Laws|t2        -133.831   35.920   -3.726 NA             NA

    Laws|t3        -133.113   26.692   -4.987 NA             NA

    Laws|t4        -131.765   23.392   -5.633 NA             NA

    Crisis|t1       165.647   27.179    6.095 NA             NA

    Crisis|t2       166.557   26.585    6.265 NA             NA

    Crisis|t3       167.091   27.430    6.092 NA             NA

    Crisis|t4       167.873   31.815    5.277 NA             NA

    Spaceship|t1   -116.915   36.868   -3.171 NA             NA

    Spaceship|t2   -116.253   26.553   -4.378 NA             NA

    Spaceship|t3   -115.710   23.379   -4.949 NA             NA

    Spaceship|t4   -114.328   22.509   -5.079 NA             NA

    Rule|t1         117.243   22.770    5.149 NA             NA

    Rule|t2         117.992   22.281    5.296 NA             NA

    Rule|t3         118.424   22.901    5.171 NA             NA

    Rule|t4         119.133   26.202    4.547 NA             NA

    Balance|t1     -112.160   62.598   -1.792 NA             NA

    Balance|t2     -110.969   26.827   -4.136 NA             NA

    Balance|t3     -110.519   23.636   -4.676 NA             NA

    Balance|t4     -109.109   21.834   -4.997 NA             NA

    Learn|t1         97.905   25.311    3.868 NA             NA

    Learn|t2         98.689   21.204    4.654 NA             NA

    Learn|t3         99.476   20.556    4.839 NA             NA

    Learn|t4        100.536   24.049    4.181 NA             NA

    Eco_crsis|t1   -214.119   58.570   -3.656 NA             NA

    Eco_crsis|t2   -213.406   38.578   -5.532 NA             NA

    Eco_crsis|t3   -212.793   33.414   -6.368 NA             NA

    Eco_crsis|t4   -211.629   31.236   -6.775 NA             NA

    Frq_f_vst_yO|1   -1.646   23.978   -0.069 NA             NA

    Frq_f_vst_yO|2   -1.417   20.863   -0.068 NA             NA

    Frq_f_vst_yO|3   -1.213   18.785   -0.065 NA             NA

    Frq_f_vst_yO|4   -0.873   16.361   -0.053 NA             NA

    Frq_f_vst_yO|5   -0.367   14.563   -0.025 NA             NA

    Frq_f_vst_yO|6    0.476   14.810    0.032 NA             NA

    Frq_f_vst_yO|7    1.315   19.744    0.067 NA             NA

    Act_ftr_sch_|1   -0.350   14.532   -0.024 NA             NA

    NtrApprctn_Y|1    1.152   17.892    0.064 NA             NA

    Chldhd_mmry|t1   -1.271   19.286   -0.066 NA             NA

    Chldhd_mmry|t2   -0.225   14.343   -0.016 NA             NA

    Chldhd_mmry|t3    0.664   15.410    0.043 NA             NA

    Chldhd_mmry|t4    1.686   24.638    0.068 NA             NA

    NtrApprctn_N|1  -54.388   22.170   -2.453 NA             NA

    Frq_f_vst_nO|1  -23.758   21.431   -1.109 NA             NA

    Frq_f_vst_nO|2  -23.557   19.857   -1.186 NA             NA

    Frq_f_vst_nO|3  -23.278   18.292   -1.273 NA             NA

    Frq_f_vst_nO|4  -22.770   16.845   -1.352 NA             NA

    Frq_f_vst_nO|5  -21.994   17.097   -1.286 NA             NA

    Frq_f_vst_nO|6  -21.977   17.133   -1.283 NA             NA

    Frq_f_vst_nO|7  -21.237   20.666   -1.028 NA             NA

    Frq_f_vst_nO|8  -21.226   20.752   -1.023 NA             NA

    Frq_f_vst_nO|9  -20.540   30.383   -0.676 NA             NA

 

Variances:

                   Estimate  Std.Err  t-value       df  P(>|t|)

   .Male              1.188                                   

   .Age             128.455  525.868    0.244 NA             NA

   .Single            1.000                                   

   .HHincomprprsnK    3.035   30.456    0.100 NA             NA

   .Housing_type      1.000                                   

   .Extrvrtd_Enths    0.684                                    

   .Criticl_qrrlsm    0.984                                   

   .Dpndbl_Slfdscp    0.743                                   

   .Anxious_slypst    0.892                                   

   .Opentnwx_cmplx    0.843                                    

   .Reserved_quiet    0.855                                   

   .Sympathetc_wrm    0.854                                   

   .Disrgnsd_crlss    0.877                                   

   .Clm_mtnllystbl    0.831                                    

   .Convntnl_ncrtv    0.983                                   

   .Limit             0.740                                   

   .Modify            0.877                                   

   .Interfere         0.794                                   

   .Ingenuity         0.876                                   

   .Abuse             0.481                                   

   .NatRes            0.997                                   

   .Rights            0.786                                   

   .Industrial        0.708                                   

   .Laws              0.764                                   

   .Crisis            0.625                                   

   .Spaceship         0.821                                   

   .Rule              0.812                                   

   .Balance           0.837                                   

   .Learn             0.867                                   

   .Eco_crsis         0.392                                   

   .Frq_f_vst_yngO    0.785                                   

   .Act_ftr_schl_t    0.681                                   

   .NtrApprctn_Yng    0.978                                   

   .Childhood_mmry    0.762                                   

   .NatrApprctn_Nw    1.005                                   

   .Frq_f_vst_nwOr    1.002                                   

   .Instrumental      0.007    6.717    0.001 NA             NA

   .Relational        0.021    7.507    0.003 NA             NA

   .Intrinsic         0.136    6.648    0.020 NA             NA

    socioecon        -0.188  154.491   -0.001 NA             NA

   .personality       0.014    1.747    0.008 NA             NA

   .NEP              -1.099    5.630   -0.195 NA             NA

   .pastexposure      0.215    6.448    0.033 NA             NA

   .currentbehav     -0.047   47.790   -0.001 NA             NA

 

Scales y*:

                   Estimate  Std.Err  t-value       df  P(>|t|)

    Male              1.000                                   

    Single            1.000                                   

    Housing_type      1.000                                   

    Extrvrtd_Enths    1.000                                   

    Criticl_qrrlsm    1.000                                   

    Dpndbl_Slfdscp    1.000                                   

    Anxious_slypst    1.000                                   

    Opentnwx_cmplx    1.000                                   

    Reserved_quiet    1.000                                   

    Sympathetc_wrm    1.000                                   

    Disrgnsd_crlss    1.000                                   

    Clm_mtnllystbl    1.000                                   

    Convntnl_ncrtv    1.000                                   

    Limit             1.000                                   

    Modify            1.000                                   

    Interfere         1.000                                   

    Ingenuity         1.000                                   

    Abuse             1.000                                   

    NatRes            1.000                                   

    Rights            1.000                                   

    Industrial        1.000                                   

    Laws              1.000                                   

    Crisis            1.000                                   

    Spaceship         1.000                                   

    Rule              1.000                                   

    Balance           1.000                                   

    Learn             1.000                                   

    Eco_crsis         1.000                                   

    Frq_f_vst_yngO    1.000                                   

    Act_ftr_schl_t    1.000                                   

    NtrApprctn_Yng    1.000                                   

    Childhood_mmry    1.000                                   

    NatrApprctn_Nw    1.000                                   

    Frq_f_vst_nwOr    1.000

Mauricio Garnier-Villarreal

unread,
Mar 11, 2019, 2:13:50 AM3/11/19
to lavaan
First would suggest to change estimator to "WLSMV". This corrects standard erros and fit indices.
second, could you share your imputation code?
...

Sin Ching See

unread,
Mar 11, 2019, 4:42:44 AM3/11/19
to lavaan
I have changed the estimator to "WLSMV" but it seems that there are more warnings now. I also took out a few variables from socio-demo factors because they are not so important and changed freq_of_visit to a dummy coded variable 

VBNlessSEmodel <-'
#measurement model 
socioecon =~ Male + Age + Single + HHincomeperpersonK + Housing_type
personality =~ Extraverted_Enthusiastic + Critical_quarrelsome + Dependable_Selfdiscipline + Anxious_easilyupset + Opentonewex_complex + Reserved_quiet + Sympathetic_warm + Disorganised_careless + Calm_emotionallystable + Conventional_uncreative
NEP=~ Limit + Modify + Interfere + Ingenuity + Abuse + NatRes + Rights + Industrial + Laws + Crisis + Spaceship + Rule + Balance + Learn + Eco_crsis
pastexposure =~ Freq_young_B + Act_after_school_outdoors + NatureAppreciation_Young  + Childhood_memory 
currentbehav =~ NatureAppreciation_Now + Freq_now_B

#regression 
currentbehav ~ NEP 
NEP ~ Instrumental + Relational + Intrinsic 
Instrumental ~ personality + pastexposure 
Relational ~ personality + pastexposure 
Intrinsic ~ personality + pastexposure 
personality ~ socioecon + pastexposure
pastexposure ~ socioecon
'

fit9 <- sem.mi(VBNlessSEmodel, data= mi_list, estimator ="WLSMV", orthogonal = TRUE,
               ordered = c("Freq_now_B", "Freq_young_B", "NatureAppreciation_Now", "NatureAppreciation_Young", "Act_after_school_outdoors", "Childhood_memory", 
                           "Extraverted_Enthusiastic", "Critical_quarrelsome", "Dependable_Selfdiscipline", "Anxious_easilyupset", "Opentonewex_complex", "Reserved_quiet", "Sympathetic_warm", "Disorganised_careless", "Calm_emotionallystable", "Conventional_uncreative",
                           "Limit", "Modify", "Interfere", "Ingenuity", "Abuse", "NatRes", "Rights", "Industrial", "Laws", "Crisis", "Spaceship", "Rule", "Balance", "Learn", "Eco_crsis",
                           "Male", "Single", "Housing_type"
))

There were 30 warnings (use warnings() to see them)
> warnings()
Warning messages:
1: In lav_model_vcov(lavmodel = lavmodel, lavsamplestats = lavsamplestats,  ... :
  lavaan WARNING:
    Could not compute standard errors! The information matrix could
    not be inverted. This may be a symptom that the model is not
    identified.
2: In lav_test_satorra_bentler(lavobject = NULL, lavsamplestats = lavsamplestats,  ... :
  lavaan WARNING: could not invert information matrix

3: In lav_object_post_check(object) :
  lavaan WARNING: some estimated ov variances are negative
4: In lav_object_post_check(object) :
  lavaan WARNING: some estimated lv variances are negative
5: In lavaan::lavaan(model = "\n#measurement model \nsocioecon =~ Male + Age + Single + Singaporean + Chinese + NoReligion + Hokkien + HHincomeperpersonK + Housing_type\npersonality =~ Extraverted_Enthusiastic + Critical_quarrelsome + Dependable_Selfdiscipline + Anxious_easilyupset + Opentonewex_complex + Reserved_quiet + Sympathetic_warm + Disorganised_careless + Calm_emotionallystable + Conventional_uncreative\nNEP=~ Limit + Modify + Interfere + Ingenuity + Abuse + NatRes + Rights + Industrial + Laws + Crisis + Spaceship + Rule + Balance + Learn + Eco_crsis\npastexposure =~ Freq_young_B + Act_after_school_outdoors + NatureAppreciation_Young  + Childhood_memory \ncurrentbehav =~ NatureAppreciation_Now + Freq_now_B\n\n#regression \ncurrentbehav ~ NEP \nNEP ~ Instrumental + Relational + Intrinsic \nInstrumental ~ personality + pastexposure \nRelational ~ personality + pastexposure \nIntrinsic ~ personality + pastexposure \npersonality ~ socioecon + pastexposure\npastexposure ~ socioecon\n",  ... :
  lavaan WARNING: not all elements of the gradient are (near) zero;
                  the optimizer may not have found a local solution;
                  use lavInspect(fit, "optim.gradient") to investigate
6: In lav_model_vcov(lavmodel = lavmodel, lavsamplestats = lavsamplestats,  ... :
  lavaan WARNING:
    Could not compute standard errors! The information matrix could
    not be inverted. This may be a symptom that the model is not
    identified.
7: In lav_test_satorra_bentler(lavobject = NULL, lavsamplestats = lavsamplestats,  ... :
  lavaan WARNING: could not invert information matrix

8: In lav_object_post_check(object) :
  lavaan WARNING: some estimated ov variances are negative
9: In lav_object_post_check(object) :
  lavaan WARNING: some estimated lv variances are negative
10: In lavaan(slotOptions = structure(list(model.type = "sem",  ... :
  lavaan WARNING: not all elements of the gradient are (near) zero;
                  the optimizer may not have found a local solution;
                  use lavInspect(fit, "optim.gradient") to investigate
11: In lav_model_vcov(lavmodel = lavmodel, lavsamplestats = lavsamplestats,  ... :
  lavaan WARNING:
    Could not compute standard errors! The information matrix could
    not be inverted. This may be a symptom that the model is not
    identified.
12: In lav_test_satorra_bentler(lavobject = NULL, lavsamplestats = lavsamplestats,  ... :
  lavaan WARNING: could not invert information matrix

13: In lav_object_post_check(object) :
  lavaan WARNING: some estimated ov variances are negative
14: In lav_object_post_check(object) :
  lavaan WARNING: some estimated lv variances are negative
15: In lavaan(slotOptions = structure(list(model.type = "sem",  ... :
  lavaan WARNING: not all elements of the gradient are (near) zero;
                  the optimizer may not have found a local solution;
                  use lavInspect(fit, "optim.gradient") to investigate
16: In lav_model_vcov(lavmodel = lavmodel, lavsamplestats = lavsamplestats,  ... :
  lavaan WARNING:
    Could not compute standard errors! The information matrix could
    not be inverted. This may be a symptom that the model is not
    identified.
17: In lav_test_satorra_bentler(lavobject = NULL, lavsamplestats = lavsamplestats,  ... :
  lavaan WARNING: could not invert information matrix

18: In lav_object_post_check(object) :
  lavaan WARNING: some estimated ov variances are negative
19: In lav_object_post_check(object) :
  lavaan WARNING: some estimated lv variances are negative
20: In lavaan(slotOptions = structure(list(model.type = "sem",  ... :
  lavaan WARNING: not all elements of the gradient are (near) zero;
                  the optimizer may not have found a local solution;
                  use lavInspect(fit, "optim.gradient") to investigate
21: In lav_model_vcov(lavmodel = lavmodel, lavsamplestats = lavsamplestats,  ... :
  lavaan WARNING:
    Could not compute standard errors! The information matrix could
    not be inverted. This may be a symptom that the model is not
    identified.
22: In lav_test_satorra_bentler(lavobject = NULL, lavsamplestats = lavsamplestats,  ... :
  lavaan WARNING: could not invert information matrix

23: In lav_object_post_check(object) :
  lavaan WARNING: some estimated ov variances are negative
24: In lav_object_post_check(object) :
  lavaan WARNING: some estimated lv variances are negative
25: In lavaan(slotOptions = structure(list(model.type = "sem",  ... :
  lavaan WARNING: not all elements of the gradient are (near) zero;
                  the optimizer may not have found a local solution;
                  use lavInspect(fit, "optim.gradient") to investigate
26: In lav_model_vcov(lavmodel = lavmodel, lavsamplestats = lavsamplestats,  ... :
  lavaan WARNING:
    Could not compute standard errors! The information matrix could
    not be inverted. This may be a symptom that the model is not
    identified.
27: In lav_test_satorra_bentler(lavobject = NULL, lavsamplestats = lavsamplestats,  ... :
  lavaan WARNING: could not invert information matrix

28: In lav_object_post_check(object) :
  lavaan WARNING: some estimated ov variances are negative
29: In lav_object_post_check(object) :
  lavaan WARNING: some estimated lv variances are negative
30: In lavaan(slotOptions = structure(list(model.type = "sem",  ... :
  lavaan WARNING: not all elements of the gradient are (near) zero;
                  the optimizer may not have found a local solution;
                  use lavInspect(fit, "optim.gradient") to investigate


Also, it seems like standard errors are not computed 

> summary(fit9)
Error in .local(object, ...) : 
  Standard errors could not be computed in any imputations, so it is not possible to calculate the within-imputation portion of sampling variance.


Here is my imputation code, I used method = "pmm" here. However, I also tried using method = "cart" because I have a mix of continuous and categorical variables in my data. Both methods of imputations seem to be give me similar output after introducing into sem.mi


fulldata_complete2 = select(fulldata, Male, Age, Singaporean, Chinese, Hokkien, NoReligion, Single, HHincomeperpersonK, Housing_type, 
                            Extraverted_Enthusiastic, Critical_quarrelsome, Dependable_Selfdiscipline, Anxious_easilyupset, Opentonewex_complex, Reserved_quiet, Sympathetic_warm, Disorganised_careless, Calm_emotionallystable, Conventional_uncreative,
                            Act_after_school_outdoors, Childhood_memory, Freq_now_B, Freq_young_B, NatureAppreciation_Now, NatureAppreciation_Young, Freq_of_visit_nowConK, Freq_of_visit_youngConK,
                            Limit, Modify, Interfere, Ingenuity, Abuse, NatRes, Rights, Industrial, Laws, Crisis, Spaceship, Rule, Balance, Learn, Eco_crsis,
                            Instrumental, Relational, Intrinsic)


imputed_fulldata <- mice(fulldata_complete2, m =5, maxit = 50, method = "pmm", seed = "500")
summary(imputed_fulldata)

df1 = complete(imputed_fulldata,1)
df2 = complete(imputed_fulldata,2)
df3 = complete(imputed_fulldata,3)
df4 = complete(imputed_fulldata,4)
df5 = complete(imputed_fulldata,5)

mi_list <- list(df1, df2, df3, df4, df5)
sapply(mi_list, class)

Terrence Jorgensen

unread,
Mar 11, 2019, 5:24:05 AM3/11/19
to lavaan
I have changed the estimator to "WLSMV" but it seems that there are more warnings now.

Is your sample size at least 1000?  Large samples are required for DWLS estimation, and for the subsequent robust corrections to work as expected.  Your model is quite large, so the sample size will need to be very large as well.

Try fitting a CFA before a structural regression model.  Also, try fitting pieces of your model (e.g., 

I also took out a few variables from socio-demo factors because they are not so important and changed freq_of_visit to a dummy coded variable 

VBNlessSEmodel <-'
#measurement model 
socioecon =~ Male + Age + Single + HHincomeperpersonK + Housing_type

socioecon is not a common factor.  This model implies that raising socioecon by 1 unit would simultaneously affect respondents' sex, age, marital status, income, and housing type.  SES is a famous example of a "formative construct", which you can search to find much literature about (or ask on SEMNET).


Modeling SES as a common factor might be causing some of your problems, which could be resolved by treating those socioeconomic indicators as independent indicators, or by modeling SES as a formative construct (which cannot be modeled unless SES predicts another outcome).

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


Sin Ching See

unread,
Mar 12, 2019, 1:52:03 AM3/12/19
to lavaan
Thanks for the reply! 

My sample size is only 501, do you recommend me to keep using DWLS? I'm thinking of respecifying my model such that endogenous variables are all continuous so that I can use MLR as an estimator instead. 

I ran CFA on my measurement model and it shows that there is no solution: 

LVCFA2 <-'
#measurement model 
socioecon =~ Male + Age + Singaporean + Chinese + NoReligion + Single + HHincomeperpersonK + Housing_type
personality =~ Extraverted_Enthusiastic + Critical_quarrelsome + Dependable_Selfdiscipline + Anxious_easilyupset + Opentonewex_complex + Reserved_quiet + Sympathetic_warm + Disorganised_careless + Calm_emotionallystable + Conventional_uncreative
NEP=~ Limit + Modify + Interfere + Ingenuity + Abuse + NatRes + Rights + Industrial + Laws + Crisis + Spaceship + Rule + Balance + Learn + Eco_crsis
pastexposure =~ Freq_young_B + Act_after_school_outdoors + NatureAppreciation_Young  + Childhood_memory 
currentbehav =~ NatureAppreciation_Now + Freq_now_B
'
Lvfit2 <- cfa(LVCFA2, data = fulldata)
summary(Lvfit2)
fitmeasure(Lvfit2)

Warning message:
In lavaan::lavaan(model = LVCFA3, data = fulldata, model.type = "cfa",  :
  lavaan WARNING: the optimizer warns that a solution has NOT been found!


So I tried running a CFA on another measurement model, where I combined currentbehav with pastexposure (changing the number of latent variables to 4), and a solution can be reached 

LVCFA <- '
#measurement model (latent variables)
socioecon =~ Male + Age + Singaporean + Chinese + Hokkien + NoReligion + Single + HHincomeperpersonK + Housing_type 
personality =~ Extraverted_Enthusiastic + Critical_quarrelsome + Dependable_Selfdiscipline + Anxious_easilyupset + Opentonewex_complex + Reserved_quiet + Sympathetic_warm + Disorganised_careless + Calm_emotionallystable + Conventional_uncreative
envtproness =~ Limit + Modify + Interfere + Ingenuity + Abuse + NatRes + Rights + Industrial + Laws + Crisis + Spaceship + Rule + Balance + Learn + Eco_crsis
pastexposure =~ Act_after_school_outdoors + Freq_young_B + NatureAppreciation_Young + Freq_now_B + NatureAppreciation_Now + Childhood_memory
'

lavaan 0.6-3 ended normally after 107 iterations

  Optimization method                           NLMINB
  Number of free parameters                         86

                                                  Used       Total
  Number of observations                           309         501

  Estimator                                         ML
  Model Fit Test Statistic                    1917.905
  Degrees of freedom                               734
  P-value (Chi-square)                           0.000

Model test baseline model:

  Minimum Function Test Statistic             2730.281
  Degrees of freedom                               780
  P-value                                        0.000

User model versus baseline model:

  Comparative Fit Index (CFI)                    0.393
  Tucker-Lewis Index (TLI)                       0.355

Loglikelihood and Information Criteria:

  Loglikelihood user model (H0)             -15993.339
  Loglikelihood unrestricted model (H1)     -15034.387

  Number of free parameters                         86
  Akaike (AIC)                               32158.678
  Bayesian (BIC)                             32479.746
  Sample-size adjusted Bayesian (BIC)        32206.988

Root Mean Square Error of Approximation:

  RMSEA                                          0.072
  90 Percent Confidence Interval          0.068  0.076
  P-value RMSEA <= 0.05                          0.000

Standardized Root Mean Square Residual:

  SRMR                                           0.088

Parameter Estimates:

  Information                                 Expected
  Information saturated (h1) model          Structured
  Standard Errors                             Standard

Latent Variables:
                   Estimate  Std.Err  z-value  P(>|z|)
  socioecon =~                                        
    Male              1.000                           
    Age               2.715    1.122    2.420    0.016
    Singaporean       0.035    0.040    0.862    0.389
    Chinese           0.087    0.048    1.826    0.068
    Hokkien           0.083    0.077    1.086    0.277
    NoReligion        0.119    0.081    1.468    0.142
    Single           -0.027    0.060   -0.444    0.657
    HHincomprprsnK    0.168    0.231    0.726    0.468
    Housing_type      0.050    0.447    0.111    0.912
  personality =~                                      
    Extrvrtd_Enths    1.000                           
    Criticl_qrrlsm   -0.362    0.171   -2.117    0.034
    Dpndbl_Slfdscp    0.850    0.182    4.661    0.000
    Anxious_slypst   -0.730    0.194   -3.769    0.000
    Opentnwx_cmplx    0.529    0.143    3.704    0.000
    Reserved_quiet   -0.715    0.191   -3.736    0.000
    Sympathetc_wrm    0.530    0.145    3.654    0.000
    Disrgnsd_crlss   -0.670    0.191   -3.500    0.000
    Clm_mtnllystbl    0.720    0.177    4.074    0.000
    Convntnl_ncrtv   -0.193    0.141   -1.370    0.171
  envtproness =~                                      
    Limit             1.000                           
    Modify           -0.174    0.179   -0.973    0.331
    Interfere         1.000    0.193    5.178    0.000
    Ingenuity        -0.025    0.177   -0.142    0.887
    Abuse             1.317    0.197    6.696    0.000
    NatRes            0.303    0.168    1.804    0.071
    Rights            0.884    0.184    4.803    0.000
    Industrial       -0.499    0.210   -2.378    0.017
    Laws              0.931    0.163    5.725    0.000
    Crisis           -0.533    0.197   -2.699    0.007
    Spaceship         1.070    0.190    5.631    0.000
    Rule             -0.198    0.206   -0.960    0.337
    Balance           0.826    0.161    5.118    0.000
    Learn             0.068    0.171    0.398    0.691
    Eco_crsis         1.445    0.212    6.812    0.000
  pastexposure =~                                     
    Act_ftr_schl_t    1.000                           
    Freq_young_B      1.236    0.195    6.340    0.000
    NtrApprctn_Yng   -0.065    0.086   -0.751    0.453
    Freq_now_B        0.703    0.149    4.718    0.000
    NatrApprctn_Nw    0.007    0.102    0.067    0.946
    Childhood_mmry    2.241    0.375    5.981    0.000

Covariances:
                   Estimate  Std.Err  z-value  P(>|z|)
  socioecon ~~                                        
    personality       0.013    0.028    0.474    0.635
    envtproness      -0.015    0.013   -1.120    0.263
    pastexposure     -0.005    0.009   -0.516    0.606
  personality ~~                                      
    envtproness      -0.023    0.026   -0.869    0.385
    pastexposure      0.113    0.027    4.107    0.000
  envtproness ~~                                      
    pastexposure      0.011    0.009    1.271    0.204

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)
   .Male              0.052    0.080    0.654    0.513
   .Age               3.817    0.663    5.758    0.000
   .Singaporean       0.071    0.006   12.419    0.000
   .Chinese           0.062    0.005   12.300    0.000
   .Hokkien           0.244    0.020   12.410    0.000
   .NoReligion        0.232    0.019   12.379    0.000
   .Single            0.175    0.014   12.427    0.000
   .HHincomprprsnK    2.443    0.197   12.423    0.000
   .Housing_type      9.807    0.789   12.430    0.000
   .Extrvrtd_Enths    2.221    0.212   10.500    0.000
   .Criticl_qrrlsm    2.716    0.222   12.225    0.000
   .Dpndbl_Slfdscp    1.333    0.132   10.104    0.000
   .Anxious_slypst    2.412    0.210   11.488    0.000
   .Opentnwx_cmplx    1.339    0.116   11.540    0.000
   .Reserved_quiet    2.381    0.207   11.515    0.000
   .Sympathetc_wrm    1.407    0.122   11.578    0.000
   .Disrgnsd_crlss    2.569    0.220   11.686    0.000
   .Clm_mtnllystbl    1.780    0.159   11.186    0.000
   .Convntnl_ncrtv    1.979    0.160   12.350    0.000
   .Limit             0.743    0.063   11.764    0.000
   .Modify            1.319    0.106   12.419    0.000
   .Interfere         0.793    0.067   11.806    0.000
   .Ingenuity         1.316    0.106   12.430    0.000
   .Abuse             0.258    0.029    8.921    0.000
   .NatRes            1.115    0.090   12.389    0.000
   .Rights            0.818    0.068   11.959    0.000
   .Industrial        1.657    0.134   12.356    0.000
   .Laws              0.439    0.038   11.446    0.000
   .Crisis            1.418    0.115   12.332    0.000
   .Spaceship         0.629    0.055   11.525    0.000
   .Rule              1.758    0.142   12.419    0.000
   .Balance           0.566    0.048   11.834    0.000
   .Learn             1.231    0.099   12.428    0.000
   .Eco_crsis         0.219    0.029    7.563    0.000
   .Act_ftr_schl_t    0.150    0.016    9.647    0.000
   .Freq_young_B      0.129    0.017    7.539    0.000
   .NtrApprctn_Yng    0.100    0.008   12.413    0.000
   .Freq_now_B        0.199    0.017   11.429    0.000
   .NatrApprctn_Nw    0.142    0.011   12.430    0.000
   .Childhood_mmry    0.805    0.082    9.838    0.000
    socioecon         0.197    0.082    2.402    0.016
    personality       0.552    0.175    3.152    0.002
    envtproness       0.168    0.047    3.570    0.000
    pastexposure      0.066    0.016    4.136    0.000


I also ran a CFA without the socioeconomic factor, considering how it shouldn't really be considered a latent variable 

LVCFA3 <-' 
personality =~ Extraverted_Enthusiastic + Critical_quarrelsome + Dependable_Selfdiscipline + Anxious_easilyupset + Opentonewex_complex + Reserved_quiet + Sympathetic_warm + Disorganised_careless + Calm_emotionallystable + Conventional_uncreative
NEP=~ Limit + Modify + Interfere + Ingenuity + Abuse + NatRes + Rights + Industrial + Laws + Crisis + Spaceship + Rule + Balance + Learn + Eco_crsis
pastexposure =~ Freq_young_B + Act_after_school_outdoors + NatureAppreciation_Young  + Childhood_memory
currentbehav =~ NatureAppreciation_Now + Freq_now_B'

Lvfit3 <- cfa(LVCFA3, data = fulldata)

There was a warning message, but a solution was reached too 

Warning message:
In lav_object_post_check(object) :
  lavaan WARNING: covariance matrix of latent variables
                is not positive definite;
                use lavInspect(fit, "cov.lv") to investigate.

lavaan 0.6-3 ended normally after 100 iterations

  Optimization method                           NLMINB
  Number of free parameters                         68

                                                  Used       Total
  Number of observations                           494         501

  Estimator                                         ML
  Model Fit Test Statistic                    1908.862
  Degrees of freedom                               428
  P-value (Chi-square)                           0.000

Model test baseline model:

  Minimum Function Test Statistic             3129.332
  Degrees of freedom                               465
  P-value                                        0.000

User model versus baseline model:

  Comparative Fit Index (CFI)                    0.444
  Tucker-Lewis Index (TLI)                       0.396

Loglikelihood and Information Criteria:

  Loglikelihood user model (H0)             -20853.089
  Loglikelihood unrestricted model (H1)     -19898.658

  Number of free parameters                         68
  Akaike (AIC)                               41842.178
  Bayesian (BIC)                             42127.950
  Sample-size adjusted Bayesian (BIC)        41912.117

Root Mean Square Error of Approximation:

  RMSEA                                          0.084
  90 Percent Confidence Interval          0.080  0.088
  P-value RMSEA <= 0.05                          0.000

Standardized Root Mean Square Residual:

  SRMR                                           0.091

Parameter Estimates:

  Information                                 Expected
  Information saturated (h1) model          Structured
  Standard Errors                             Standard

Latent Variables:
                   Estimate  Std.Err  z-value  P(>|z|)
  personality =~                                      
    Extrvrtd_Enths    1.000                           
    Criticl_qrrlsm   -0.207    0.118   -1.752    0.080
    Dpndbl_Slfdscp    0.872    0.136    6.405    0.000
    Anxious_slypst   -0.563    0.133   -4.234    0.000
    Opentnwx_cmplx    0.607    0.108    5.611    0.000
    Reserved_quiet   -0.618    0.132   -4.688    0.000
    Sympathetc_wrm    0.558    0.108    5.175    0.000
    Disrgnsd_crlss   -0.688    0.139   -4.951    0.000
    Clm_mtnllystbl    0.666    0.123    5.437    0.000
    Convntnl_ncrtv   -0.183    0.103   -1.778    0.075
  NEP =~                                              
    Limit             1.000                           
    Modify           -0.338    0.121   -2.780    0.005
    Interfere         0.945    0.122    7.762    0.000
    Ingenuity        -0.272    0.120   -2.271    0.023
    Abuse             1.144    0.115    9.914    0.000
    NatRes            0.117    0.111    1.050    0.294
    Rights            0.731    0.112    6.531    0.000
    Industrial       -0.545    0.138   -3.945    0.000
    Laws              0.735    0.094    7.795    0.000
    Crisis           -0.788    0.136   -5.798    0.000
    Spaceship         0.839    0.112    7.473    0.000
    Rule             -0.478    0.141   -3.383    0.001
    Balance           0.761    0.104    7.327    0.000
    Learn            -0.186    0.117   -1.591    0.112
    Eco_crsis         1.319    0.128   10.316    0.000
  pastexposure =~                                     
    Freq_young_B      1.000                           
    Act_ftr_schl_t    0.816    0.114    7.167    0.000
    NtrApprctn_Yng    0.022    0.056    0.395    0.693
    Childhood_mmry    1.830    0.251    7.294    0.000
  currentbehav =~                                     
    NatrApprctn_Nw    1.000                           
    Freq_now_B        3.874    1.702    2.276    0.023

Covariances:
                   Estimate  Std.Err  z-value  P(>|z|)
  personality ~~                                      
    NEP              -0.013    0.024   -0.525    0.600
    pastexposure      0.114    0.023    4.891    0.000
    currentbehav      0.023    0.011    2.083    0.037
  NEP ~~                                              
    pastexposure      0.014    0.010    1.492    0.136
    currentbehav      0.006    0.004    1.587    0.113
  pastexposure ~~                                     
    currentbehav      0.015    0.007    2.318    0.020

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)
   .Extrvrtd_Enths    2.111    0.163   12.926    0.000
   .Criticl_qrrlsm    2.564    0.164   15.619    0.000
   .Dpndbl_Slfdscp    1.276    0.105   12.202    0.000
   .Anxious_slypst    2.512    0.168   14.981    0.000
   .Opentnwx_cmplx    1.193    0.086   13.904    0.000
   .Reserved_quiet    2.266    0.154   14.732    0.000
   .Sympathetc_wrm    1.353    0.094   14.368    0.000
   .Disrgnsd_crlss    2.377    0.163   14.551    0.000
   .Clm_mtnllystbl    1.620    0.115   14.110    0.000
   .Convntnl_ncrtv    1.958    0.125   15.616    0.000
   .Limit             0.648    0.045   14.419    0.000
   .Modify            1.284    0.082   15.643    0.000
   .Interfere         0.750    0.051   14.719    0.000
   .Ingenuity         1.270    0.081   15.668    0.000
   .Abuse             0.306    0.026   12.000    0.000
   .NatRes            1.138    0.072   15.706    0.000
   .Rights            0.787    0.052   15.151    0.000
   .Industrial        1.555    0.100   15.558    0.000
   .Laws              0.447    0.030   14.703    0.000
   .Crisis            1.276    0.083   15.312    0.000
   .Spaceship         0.676    0.046   14.846    0.000
   .Rule              1.683    0.108   15.604    0.000
   .Balance           0.595    0.040   14.903    0.000
   .Learn             1.233    0.079   15.693    0.000
   .Eco_crsis         0.247    0.025    9.725    0.000
   .Freq_young_B      0.137    0.014    9.550    0.000
   .Act_ftr_schl_t    0.169    0.014   12.409    0.000
   .NtrApprctn_Yng    0.093    0.006   15.712    0.000
   .Childhood_mmry    0.756    0.063   11.963    0.000
   .NatrApprctn_Nw    0.150    0.010   15.363    0.000
   .Freq_now_B        0.216    0.034    6.376    0.000
    personality       0.622    0.144    4.311    0.000
    NEP               0.230    0.042    5.510    0.000
    pastexposure      0.092    0.016    5.631    0.000
    currentbehav      0.001    0.002    0.496    0.620


lavInspect(Lvfit3, "cov.lv")

             prsnlt NEP    pstxps crrntb
personality   0.622                     
NEP          -0.013  0.230              
pastexposure  0.114  0.014  0.092       
currentbehav  0.023  0.006  0.015  0.001
Reply all
Reply to author
Forward
0 new messages