SEM & marker variable

465 views
Skip to first unread message

Noortje de Boer

unread,
Apr 3, 2017, 8:44:46 AM4/3/17
to lavaan
Dear all,

I am running a SEM model with 1 IV (OM_M), 3 DVs which covary (FC, EP, AC), 1 Mediator (RES) and several controls (LEEFTIJD, RULEOBEDIENCE, GESLACHT_D_VROUW)

I use the MLM Satorro Bentler estimator since my data does not meet all assumptions of multivariate normality.

OM.mate.model <- '
#define DVs
FC =~ F1 + F3 + F5 + C4 + C5
EP =~ E3 + E4 + E5 + P5
AC =~ A2 + A3 + A4 + A5

#define M
RES =~ RESIS1_RC + RESIS2_RC + RESIS3_RC

#define IV
OM_M =~ OM_M1 + OM_M2 + OM_M3 + OM_M4

#covariances DV 
FC ~~ EP
FC ~~ AC
AC ~~ EP

#direct effect
FC ~ c1*OM_M + LEEFTIJD + RULEOBEDIENCE
EP ~ c2*OM_M + LEEFTIJD + WERKERVARING 
AC ~ c3*OM_M + LEEFTIJD + GESLACHT_D_VROUW 

#indirect effects
RES ~ a*OM_M + RULEOBEDIENCE #only rule obedience correlated with resistance
FC ~ b1*RES 
EP ~ b2*RES 
AC ~ b3*RES 
ab1 := a*b1
ab2 := a*b2
ab3 := a*b3 

'

My model runs fine, but now I want to check for common method variance by adding a latent variable and a marker variable. My syntax is as follows:
CMB.marker <- '
#define DVs
FC =~ F1 + F3 + F5 + C4 + C5
EP =~ E3 + E4 + E5 + P5
AC =~ A2 + A3 + A4 + A5

#define M
RES =~ RESIS1_RC + RESIS2_RC + RESIS3_RC

#define IV
OM_M =~ OM_M1 + OM_M2 + OM_M3 

#covariances DV (all measure 1 dimension of inspection style)
FC ~~ EP
FC ~~ AC
AC ~~ EP

#direct effect
FC ~ c1*OM_M + LEEFTIJD + RULEOBEDIENCE
EP ~ c2*OM_M + LEEFTIJD + WERKERVARING 
AC ~ c3*OM_M + LEEFTIJD + GESLACHT_D_VROUW 

#indirect effects
RES ~ a*OM_M + RULEOBEDIENCE #only rule obedience correlated with resistance
FC ~ b1*RES 
EP ~ b2*RES 
AC ~ b3*RES 
ab1 := a*b1
ab2 := a*b2
ab3 := a*b3 

#define common latent variable
#constraining factor loadings to be equal
CLF =~ F1 + cmb*F3 + cmb*F5 + cmb*C4 + cmb*C5 +
       cmb*E3 + cmb*E4 + cmb*E5 + cmb*P5 +
       cmb*A2 + cmb*A3 + cmb*A4 + cmb*A5 +
       cmb*RESIS1_RC + cmb*RESIS2_RC + cmb*RESIS3_RC +
       cmb*OM_M1 + cmb*OM_M2 + cmb*OM_M3 +
       Marker
    
#contraining variance of CLF to be 1
CLF ~~ 1*CLF

#adding marker variable: KM_gebruik_uren
#constraining factor loadings to be equal
Marker =~ cmb*KM_gebruik_uren
#covary with other latent variables
Marker ~~ FC
Marker ~~ EP
Marker ~~ AC
Marker ~~ RES
Marker ~~ OM_M

'

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

I indeed find negative covariances between my latent variables
Regressions:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  FC ~                                                                  
    OM_M      (c1)   -0.461    0.119   -3.871    0.000   -0.150   -0.150
    LEEFTIJD          0.025    0.011    2.272    0.023    0.013    0.163
    GESLACHT_         0.332    0.201    1.657    0.097    0.170    0.076
    GESLACHT_        -0.129    0.688   -0.187    0.851   -0.066   -0.004
    WERKERVAR        -0.016    0.009   -1.706    0.088   -0.008   -0.093
    RULEOBEDI        -0.037    0.053   -0.690    0.490   -0.019   -0.047
  EP ~                                                                  
    OM_M      (c2)   -0.277    0.119   -2.319    0.020   -0.091   -0.091
    LEEFTIJD          0.017    0.011    1.596    0.110    0.009    0.112
    GESLACHT_         0.256    0.230    1.113    0.266    0.132    0.059
    GESLACHT_         0.842    0.391    2.157    0.031    0.433    0.027
    WERKERVAR         0.013    0.010    1.306    0.191    0.007    0.076
    RULEOBEDI        -0.060    0.052   -1.147    0.251   -0.031   -0.078
  AC ~                                                                  
    OM_M      (c3)   -0.075    0.104   -0.722    0.471   -0.025   -0.025
    LEEFTIJD          0.012    0.009    1.349    0.177    0.006    0.083
    GESLACHT_        -0.062    0.223   -0.277    0.782   -0.032   -0.014
    GESLACHT_        -1.943    2.687   -0.723    0.470   -1.014   -0.064
    WERKERVAR        -0.004    0.010   -0.443    0.658   -0.002   -0.025
    RULEOBEDI        -0.035    0.050   -0.692    0.489   -0.018   -0.046
  RES ~                                                                 
    OM_M       (a)   -1.195    0.296   -4.042    0.000   -0.307   -0.307
    LEEFTIJD         -0.008    0.010   -0.775    0.439   -0.003   -0.042
    GESLACHT_        -0.372    0.222   -1.674    0.094   -0.150   -0.067
    GESLACHT_         1.519    1.601    0.949    0.343    0.612    0.038
    WERKERVAR         0.007    0.011    0.641    0.521    0.003    0.032
    RULEOBEDI         0.261    0.063    4.139    0.000    0.105    0.265
  FC ~                                                                  
    RES       (b1)    0.429    0.144    2.984    0.003    0.545    0.545
  EP ~                                                                  
    RES       (b2)    0.286    0.126    2.267    0.023    0.365    0.365
  AC ~                                                                  
    RES       (b3)    0.302    0.101    2.999    0.003    0.391    0.391

Covariances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
 .FC ~~                                                                 
   .EP                1.958    0.462    4.240    0.000    0.714    0.714
   .AC                1.272    0.343    3.713    0.000    0.467    0.467
 .EP ~~                                                                 
   .AC                1.483    0.334    4.436    0.000    0.478    0.478
  OM_M ~~                                                               
    CLF               1.689    0.312    5.406    0.000    2.648    2.648

Intercepts:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .F1                5.354    0.594    9.012    0.000    5.354    2.543
   .F3                7.014    0.615   11.410    0.000    7.014    4.394
   .F5                6.600    0.613   10.758    0.000    6.600    3.508
   .C4                7.239    0.594   12.192    0.000    7.239    4.182
   .C5                6.616    0.624   10.607    0.000    6.616    4.086
   .E3                6.379    0.582   10.955    0.000    6.379    3.091
   .E4                6.595    0.597   11.050    0.000    6.595    3.303
   .E5                5.844    0.543   10.763    0.000    5.844    2.756
   .P5                5.595    0.560    9.989    0.000    5.595    2.336
   .A2                4.825    0.501    9.624    0.000    4.825    1.934
   .A3                3.910    0.419    9.323    0.000    3.910    1.572
   .A4                5.924    0.558   10.617    0.000    5.924    2.538
   .A5                5.068    0.554    9.155    0.000    5.068    2.041
   .RESIS1_RC         4.704    0.678    6.936    0.000    4.704    1.622
   .RESIS2_RC         3.243    0.687    4.720    0.000    3.243    1.417
   .RESIS3_RC         3.247    0.682    4.762    0.000    3.247    1.395
   .OM_M1             5.489    0.101   54.539    0.000    5.489    2.441
   .OM_M2             5.156    0.102   50.741    0.000    5.156    2.252
   .OM_M3             5.118    0.100   51.089    0.000    5.118    2.265
   .FC                0.000                               0.000    0.000
   .EP                0.000                               0.000    0.000
   .AC                0.000                               0.000    0.000
   .RES               0.000                               0.000    0.000
    OM_M              0.000                               0.000    0.000
    CLF               0.000                               0.000    0.000

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
    CLF               1.000                               1.000    1.000
   .F1                2.903    0.282   10.306    0.000    2.903    0.655
   .F3                1.017    0.174    5.859    0.000    1.017    0.399
   .F5                1.995    0.368    5.421    0.000    1.995    0.564
   .C4                1.700    0.340    4.996    0.000    1.700    0.568
   .C5                1.027    0.196    5.235    0.000    1.027    0.392
   .E3                1.540    0.225    6.853    0.000    1.540    0.362
   .E4                1.160    0.196    5.934    0.000    1.160    0.291
   .E5                2.285    0.241    9.490    0.000    2.285    0.508
   .P5                3.294    0.355    9.280    0.000    3.294    0.574
   .A2                3.068    0.272   11.288    0.000    3.068    0.493
   .A3                3.979    0.281   14.177    0.000    3.979    0.643
   .A4                1.659    0.246    6.753    0.000    1.659    0.304
   .A5                2.356    0.305    7.723    0.000    2.356    0.382
   .RESIS1_RC         5.063    0.363   13.941    0.000    5.063    0.602
   .RESIS2_RC         1.239    0.233    5.317    0.000    1.239    0.237
   .RESIS3_RC         1.530    0.278    5.514    0.000    1.530    0.282
   .OM_M1             0.808    0.167    4.830    0.000    0.808    0.160
   .OM_M2             1.085    0.209    5.184    0.000    1.085    0.207
   .OM_M3             1.206    0.217    5.556    0.000    1.206    0.236
   .FC                2.409    0.578    4.171    0.000    0.631    0.631
   .EP                3.123    0.472    6.620    0.000    0.824    0.824
   .AC                3.081    0.400    7.699    0.000    0.839    0.839
   .RES               5.098    1.588    3.210    0.001    0.827    0.827
    OM_M              0.407    0.419    0.971    0.332    1.000    1.000

Defined Parameters:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
    ab1              -0.512    0.275   -1.864    0.062   -0.167   -0.167
    ab2              -0.342    0.223   -1.536    0.125   -0.112   -0.112
    ab3              -0.361    0.195   -1.850    0.064   -0.120   -0.120

> #marker variable
> CMB.marker <- '
+ #define DVs
+ FC =~ F1 + F3 + F5 + C4 + C5
+ EP =~ E3 + E4 + E5 + P5
+ AC =~ A2 + A3 + A4 + A5
+ #define M
+ RES =~ RESIS1_RC + RESIS2_RC + RESIS3_RC
+ #define IV
+ OM_M =~ OM_M1 + OM_M2 + OM_M3 
+ #covariances DV (all measure 1 dimension of inspection style)
+ FC ~~ EP
+ FC ~~ AC
+ AC ~~ EP
+ #direct effect
+ FC ~ c1*OM_M + LEEFTIJD + GESLACHT_D_VROUW + GESLACHT_D_ANDERS + WERKERVARING + RULEOBEDIENCE
+ EP ~ c2*OM_M + LEEFTIJD + GESLACHT_D_VROUW + GESLACHT_D_ANDERS + WERKERVARING + RULEOBEDIENCE
+ AC ~ c3*OM_M + LEEFTIJD + GESLACHT_D_VROUW + GESLACHT_D_ANDERS + WERKERVARING + RULEOBEDIENCE
+ #mediation b/w IV and 3 DV 
+ #indirect effects
+ RES ~ a*OM_M + LEEFTIJD + GESLACHT_D_VROUW + GESLACHT_D_ANDERS + WERKERVARING + RULEOBEDIENCE
+ FC ~ b1*RES 
+ EP ~ b2*RES 
+ AC ~ b3*RES 
+ ab1 := a*b1
+ ab2 := a*b2
+ ab3 := a*b3 
+ #define common latent variable
+ #constraining factor loadings to be equal
+ CLF =~ F1 + cmb*F3 + cmb*F5 + cmb*C4 + cmb*C5 +
+        cmb*E3 + cmb*E4 + cmb*E5 + cmb*P5 +
+        cmb*A2 + cmb*A3 + cmb*A4 + cmb*A5 +
+        cmb*RESIS1_RC + cmb*RESIS2_RC + cmb*RESIS3_RC +
+        cmb*OM_M1 + cmb*OM_M2 + cmb*OM_M3 +
+        KM_gebruik_uren
+     
+ #contraining variance of CLF to be 1
+ CLF ~~ 1*CLF
+ #adding marker variable: KM_gebruik_uren
+ #constraining factor loadings to be equal
+ Marker =~ cmb*KM_gebruik_uren
+ #covary with other latent variables
+ Marker ~~ FC
+ Marker ~~ EP
+ Marker ~~ AC
+ Marker ~~ RES
+ Marker ~~ OM_M
+ '
> fit.CMB.marker <- cfa(CMB.marker, 
+                      data = NVWA2016, 
+                      estimator="MLM")
Warning messages:
1: In lav_model_vcov(lavmodel = lavmodel, lavsamplestats = lavsamplestats,  :
  lavaan WARNING: could not compute standard errors!
  lavaan NOTE: this may be a symptom that the model is not identified.

2: In lav_model_test(lavmodel = lavmodel, lavpartable = lavpartable,  :
  lavaan WARNING: could not compute scaled test statistic

3: In lav_object_post_check(object) :
  lavaan WARNING: covariance matrix of latent variables
                is not positive definite;
                use inspect(fit,"cov.lv") to investigate.
> summary(fit.CMB.marker, standardized=TRUE, fit.measures=TRUE)
lavaan (0.5-23.1097) converged normally after 230 iterations

  Number of observations                           507

  Estimator                                         ML      Robust
  Minimum Function Test Statistic              587.480          NA
  Degrees of freedom                               232         232
  P-value (Chi-square)                           0.000          NA
  Scaling correction factor                                     NA
    for the Satorra-Bentler correction

Model test baseline model:

  Minimum Function Test Statistic             5175.970    2907.974
  Degrees of freedom                               290         290
  P-value                                        0.000       0.000

User model versus baseline model:

  Comparative Fit Index (CFI)                    0.927          NA
  Tucker-Lewis Index (TLI)                       0.909          NA

  Robust Comparative Fit Index (CFI)                            NA
  Robust Tucker-Lewis Index (TLI)                               NA

Loglikelihood and Information Criteria:

  Loglikelihood user model (H0)             -24378.783  -24378.783
  Loglikelihood unrestricted model (H1)     -24085.043  -24085.043

  Number of free parameters                         98          98
  Akaike (AIC)                               48953.566   48953.566
  Bayesian (BIC)                             49367.960   49367.960
  Sample-size adjusted Bayesian (BIC)        49056.896   49056.896

Root Mean Square Error of Approximation:

  RMSEA                                          0.055          NA
  90 Percent Confidence Interval          0.049  0.061       0.000  0.000
  P-value RMSEA <= 0.05                          0.068       0.000

  Robust RMSEA                                                  NA
  90 Percent Confidence Interval                             0.000  0.000

Standardized Root Mean Square Residual:

  SRMR                                           0.047       0.047

Parameter Estimates:

  Information                                 Expected
  Standard Errors                           Robust.sem

Latent Variables:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  FC =~                                                                 
    F1                1.000                               1.860    0.895
    F3                1.035       NA                      1.926    1.204
    F5                1.039       NA                      1.932    1.027
    C4                0.976       NA                      1.816    1.047
    C5                1.049       NA                      1.951    1.205
  EP =~                                                                 
    E3                1.000                               1.968    0.954
    E4                1.022       NA                      2.011    1.006
    E5                0.896       NA                      1.764    0.835
    P5                0.960       NA                      1.889    0.785
  AC =~                                                                 
    A2                1.000                               1.920    0.772
    A3                0.833       NA                      1.600    0.640
    A4                1.114       NA                      2.139    0.915
    A5                1.105       NA                      2.123    0.857
  RES =~                                                                
    RESIS1_R          1.000                               2.499    0.865
    RESIS2_R          1.072       NA                      2.678    1.178
    RESIS3_R          1.062       NA                      2.654    1.145
  OM_M =~                                                               
    OM_M1             1.000                               0.570    0.254
    OM_M2             0.967       NA                      0.551    0.241
    OM_M3             0.911       NA                      0.519    0.229
  CLF =~                                                                
    F1                1.000                               1.000    0.481
    F3       (cmb)    1.000                               1.000    0.625
    F5       (cmb)    1.000                               1.000    0.531
    C4       (cmb)    1.000                               1.000    0.577
    C5       (cmb)    1.000                               1.000    0.618
    E3       (cmb)    1.000                               1.000    0.485
    E4       (cmb)    1.000                               1.000    0.500
    E5       (cmb)    1.000                               1.000    0.473
    P5       (cmb)    1.000                               1.000    0.416
    A2       (cmb)    1.000                               1.000    0.402
    A3       (cmb)    1.000                               1.000    0.400
    A4       (cmb)    1.000                               1.000    0.428
    A5       (cmb)    1.000                               1.000    0.404
    RESIS1_R (cmb)    1.000                               1.000    0.346
    RESIS2_R (cmb)    1.000                               1.000    0.440
    RESIS3_R (cmb)    1.000                               1.000    0.432
    OM_M1    (cmb)    1.000                               1.000    0.445
    OM_M2    (cmb)    1.000                               1.000    0.438
    OM_M3    (cmb)    1.000                               1.000    0.441
    KM_gbrk_          0.478       NA                      0.478    0.327
  Marker =~                                                             
    KM_gbrk_ (cmb)    1.000                               0.987    0.676

Regressions:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  FC ~                                                                  
    OM_M      (c1)   -0.490       NA                     -0.150   -0.150
    LEEFTIJD          0.024       NA                      0.013    0.163
    GESLACHT_         0.322       NA                      0.173    0.077
    GESLACHT_        -0.140       NA                     -0.075   -0.005
    WERKERVAR        -0.015       NA                     -0.008   -0.092
    RULEOBEDI        -0.037       NA                     -0.020   -0.050
  EP ~                                                                  
    OM_M      (c2)   -0.335       NA                     -0.097   -0.097
    LEEFTIJD          0.017       NA                      0.009    0.110
    GESLACHT_         0.273       NA                      0.139    0.062
    GESLACHT_         0.840       NA                      0.427    0.027
    WERKERVAR         0.013       NA                      0.007    0.074
    RULEOBEDI        -0.069       NA                     -0.035   -0.088
  AC ~                                                                  
    OM_M      (c3)   -0.120       NA                     -0.036   -0.036
    LEEFTIJD          0.012       NA                      0.006    0.083
    GESLACHT_        -0.056       NA                     -0.029   -0.013
    GESLACHT_        -1.949       NA                     -1.015   -0.064
    WERKERVAR        -0.004       NA                     -0.002   -0.025
    RULEOBEDI        -0.036       NA                     -0.019   -0.047
  RES ~                                                                 
    OM_M       (a)   -1.354       NA                     -0.309   -0.309
    LEEFTIJD         -0.009       NA                     -0.004   -0.045
    GESLACHT_        -0.344       NA                     -0.138   -0.061
    GESLACHT_         1.557       NA                      0.623    0.039
    WERKERVAR         0.007       NA                      0.003    0.029
    RULEOBEDI         0.247       NA                      0.099    0.249
  FC ~                                                                  
    RES       (b1)    0.412       NA                      0.553    0.553
  EP ~                                                                  
    RES       (b2)    0.298       NA                      0.378    0.378
  AC ~                                                                  
    RES       (b3)    0.309       NA                      0.402    0.402

Covariances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
 .FC ~~                                                                 
   .EP                1.864       NA                      0.717    0.717
   .AC                1.204       NA                      0.470    0.470
 .EP ~~                                                                 
   .AC                1.492       NA                      0.482    0.482
 .FC ~~                                                                 
    Marker           -0.482       NA                     -0.333   -0.333
 .EP ~~                                                                 
    Marker           -0.403       NA                     -0.230   -0.230
 .AC ~~                                                                 
    Marker           -0.354       NA                     -0.205   -0.205
 .RES ~~                                                                
    Marker           -0.853       NA                     -0.378   -0.378
  OM_M ~~                                                               
    Marker           -1.119       NA                     -1.988   -1.988
    CLF               1.461       NA                      2.562    2.562
  CLF ~~                                                                
    Marker            0.008       NA                      0.008    0.008

Intercepts:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .F1                5.484       NA                      5.484    2.637
   .F3                7.057       NA                      7.057    4.413
   .F5                6.643       NA                      6.643    3.530
   .C4                7.279       NA                      7.279    4.199
   .C5                6.662       NA                      6.662    4.115
   .E3                6.476       NA                      6.476    3.139
   .E4                6.691       NA                      6.691    3.347
   .E5                5.941       NA                      5.941    2.813
   .P5                5.678       NA                      5.678    2.360
   .A2                4.863       NA                      4.863    1.954
   .A3                3.935       NA                      3.935    1.575
   .A4                5.956       NA                      5.956    2.549
   .A5                5.108       NA                      5.108    2.063
   .RESIS1_RC         4.840       NA                      4.840    1.675
   .RESIS2_RC         3.387       NA                      3.387    1.490
   .RESIS3_RC         3.388       NA                      3.388    1.462
   .OM_M1             5.489       NA                      5.489    2.442
   .OM_M2             5.156       NA                      5.156    2.257
   .OM_M3             5.118       NA                      5.118    2.259
   .KM_gebruik_urn    1.682       NA                      1.682    1.151
   .FC                0.000                               0.000    0.000
   .EP                0.000                               0.000    0.000
   .AC                0.000                               0.000    0.000
   .RES               0.000                               0.000    0.000
    OM_M              0.000                               0.000    0.000
    CLF               0.000                               0.000    0.000
    Marker            0.000                               0.000    0.000

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
    CLF               1.000                               1.000    1.000
   .F1                2.925       NA                      2.925    0.676
   .F3                1.019       NA                      1.019    0.398
   .F5                1.988       NA                      1.988    0.561
   .C4                1.697       NA                      1.697    0.565
   .C5                1.026       NA                      1.026    0.392
   .E3                1.541       NA                      1.541    0.362
   .E4                1.157       NA                      1.157    0.290
   .E5                2.283       NA                      2.283    0.512
   .P5                3.293       NA                      3.293    0.569
   .A2                3.079       NA                      3.079    0.497
   .A3                3.991       NA                      3.991    0.640
   .A4                1.638       NA                      1.638    0.300
   .A5                2.364       NA                      2.364    0.386
   .RESIS1_RC         5.063       NA                      5.063    0.606
   .RESIS2_RC         1.238       NA                      1.238    0.239
   .RESIS3_RC         1.531       NA                      1.531    0.285
   .OM_M1             0.808       NA                      0.808    0.160
   .OM_M2             1.088       NA                      1.088    0.209
   .OM_M3             1.204       NA                      1.204    0.234
   .KM_gebruik_urn    0.925       NA                      0.925    0.433
   .FC                2.148       NA                      0.621    0.621
   .EP                3.146       NA                      0.813    0.813
   .AC                3.051       NA                      0.827    0.827
   .RES               5.214       NA                      0.835    0.835
    OM_M              0.325       NA                      1.000    1.000
    Marker            0.974       NA                      1.000    1.000

Defined Parameters:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
    ab1              -0.558                              -0.171   -0.171
    ab2              -0.404                              -0.117   -0.117
    ab3              -0.418                              -0.124   -0.124

> #marker variable
> CMB.marker <- '
+ #define DVs
+ FC =~ F1 + F3 + F5 + C4 + C5
+ EP =~ E3 + E4 + E5 + P5
+ AC =~ A2 + A3 + A4 + A5
+ #define M
+ RES =~ RESIS1_RC + RESIS2_RC + RESIS3_RC
+ #define IV
+ OM_M =~ OM_M1 + OM_M2 + OM_M3 
+ #covariances DV (all measure 1 dimension of inspection style)
+ FC ~~ EP
+ FC ~~ AC
+ AC ~~ EP
+ #direct effect
+ FC ~ c1*OM_M + LEEFTIJD + GESLACHT_D_VROUW + GESLACHT_D_ANDERS + WERKERVARING + RULEOBEDIENCE
+ EP ~ c2*OM_M + LEEFTIJD + GESLACHT_D_VROUW + GESLACHT_D_ANDERS + WERKERVARING + RULEOBEDIENCE
+ AC ~ c3*OM_M + LEEFTIJD + GESLACHT_D_VROUW + GESLACHT_D_ANDERS + WERKERVARING + RULEOBEDIENCE
+ #mediation b/w IV and 3 DV 
+ #indirect effects
+ RES ~ a*OM_M + LEEFTIJD + GESLACHT_D_VROUW + GESLACHT_D_ANDERS + WERKERVARING + RULEOBEDIENCE
+ FC ~ b1*RES 
+ EP ~ b2*RES 
+ AC ~ b3*RES 
+ ab1 := a*b1
+ ab2 := a*b2
+ ab3 := a*b3 
+ #define common latent variable
+ #constraining factor loadings to be equal
+ CLF =~ F1 + cmb*F3 + cmb*F5 + cmb*C4 + cmb*C5 +
+        cmb*E3 + cmb*E4 + cmb*E5 + cmb*P5 +
+        cmb*A2 + cmb*A3 + cmb*A4 + cmb*A5 +
+        cmb*RESIS1_RC + cmb*RESIS2_RC + cmb*RESIS3_RC +
+        cmb*OM_M1 + cmb*OM_M2 + cmb*OM_M3 +
+        Marker
+     
+ #contraining variance of CLF to be 1
+ CLF ~~ 1*CLF
+ #adding marker variable: KM_gebruik_uren
+ #constraining factor loadings to be equal
+ Marker =~ cmb*KM_gebruik_uren
+ #covary with other latent variables
+ Marker ~~ FC
+ Marker ~~ EP
+ Marker ~~ AC
+ Marker ~~ RES
+ Marker ~~ OM_M
+ '
> fit.CMB.marker <- cfa(CMB.marker, 
+                      data = NVWA2016, 
+                      estimator="MLM")
Warning message:
In lav_object_post_check(object) :
  lavaan WARNING: covariance matrix of latent variables
                is not positive definite;
                use inspect(fit,"cov.lv") to investigate.
> summary(fit.CMB.marker, standardized=TRUE, fit.measures=TRUE)
lavaan (0.5-23.1097) converged normally after 220 iterations

  Number of observations                           507

  Estimator                                         ML      Robust
  Minimum Function Test Statistic              587.480     532.237
  Degrees of freedom                               234         234
  P-value (Chi-square)                           0.000       0.000
  Scaling correction factor                                  1.104
    for the Satorra-Bentler correction

Model test baseline model:

  Minimum Function Test Statistic             5175.970    2907.974
  Degrees of freedom                               290         290
  P-value                                        0.000       0.000

User model versus baseline model:

  Comparative Fit Index (CFI)                    0.928       0.886
  Tucker-Lewis Index (TLI)                       0.910       0.859

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

Loglikelihood and Information Criteria:

  Loglikelihood user model (H0)             -24378.783  -24378.783
  Loglikelihood unrestricted model (H1)     -24085.043  -24085.043

  Number of free parameters                         96          96
  Akaike (AIC)                               48949.566   48949.566
  Bayesian (BIC)                             49355.503   49355.503
  Sample-size adjusted Bayesian (BIC)        49050.788   49050.788

Root Mean Square Error of Approximation:

  RMSEA                                          0.055       0.050
  90 Percent Confidence Interval          0.049  0.060       0.045  0.056
  P-value RMSEA <= 0.05                          0.084       0.475

  Robust RMSEA                                               0.053
  90 Percent Confidence Interval                             0.047  0.059

Standardized Root Mean Square Residual:

  SRMR                                           0.047       0.047

Parameter Estimates:

  Information                                 Expected
  Standard Errors                           Robust.sem

Latent Variables:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  FC =~                                                                 
    F1                1.000                               1.860    0.895
    F3                1.035    0.041   24.945    0.000    1.926    1.204
    F5                1.039    0.052   20.055    0.000    1.932    1.027
    C4                0.976    0.051   19.239    0.000    1.816    1.047
    C5                1.049    0.044   23.817    0.000    1.951    1.205
  EP =~                                                                 
    E3                1.000                               1.968    0.954
    E4                1.022    0.035   29.454    0.000    2.011    1.006
    E5                0.896    0.048   18.703    0.000    1.764    0.835
    P5                0.960    0.045   21.280    0.000    1.889    0.785
  AC =~                                                                 
    A2                1.000                               1.920    0.772
    A3                0.833    0.054   15.364    0.000    1.600    0.640
    A4                1.114    0.058   19.085    0.000    2.139    0.915
    A5                1.105    0.061   18.257    0.000    2.123    0.857
  RES =~                                                                
    RESIS1_R          1.000                               2.499    0.865
    RESIS2_R          1.072    0.051   21.075    0.000    2.678    1.178
    RESIS3_R          1.062    0.054   19.639    0.000    2.654    1.145
  OM_M =~                                                               
    OM_M1             1.000                               0.570    0.253
    OM_M2             0.967    0.054   18.020    0.000    0.551    0.241
    OM_M3             0.911    0.056   16.289    0.000    0.519    0.229
  CLF =~                                                                
    F1                1.000                               1.000    0.481
    F3       (cmb)    1.000                               1.000    0.625
    F5       (cmb)    1.000                               1.000    0.531
    C4       (cmb)    1.000                               1.000    0.577
    C5       (cmb)    1.000                               1.000    0.618
    E3       (cmb)    1.000                               1.000    0.485
    E4       (cmb)    1.000                               1.000    0.500
    E5       (cmb)    1.000                               1.000    0.473
    P5       (cmb)    1.000                               1.000    0.416
    A2       (cmb)    1.000                               1.000    0.402
    A3       (cmb)    1.000                               1.000    0.400
    A4       (cmb)    1.000                               1.000    0.428
    A5       (cmb)    1.000                               1.000    0.404
    RESIS1_R (cmb)    1.000                               1.000    0.346
    RESIS2_R (cmb)    1.000                               1.000    0.440
    RESIS3_R (cmb)    1.000                               1.000    0.432
    OM_M1    (cmb)    1.000                               1.000    0.445
    OM_M2    (cmb)    1.000                               1.000    0.438
    OM_M3    (cmb)    1.000                               1.000    0.441
    Marker            0.486    0.396    1.229    0.219    0.333    0.333
  Marker =~                                                             
    KM_gbrk_ (cmb)    1.000                               1.461    1.000

Regressions:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  FC ~                                                                  
    OM_M      (c1)   -0.490    0.136   -3.613    0.000   -0.150   -0.150
    LEEFTIJD          0.024    0.011    2.213    0.027    0.013    0.163
    GESLACHT_         0.322    0.191    1.684    0.092    0.173    0.077
    GESLACHT_        -0.140    0.665   -0.211    0.833   -0.075   -0.005
    WERKERVAR        -0.015    0.009   -1.694    0.090   -0.008   -0.092
    RULEOBEDI        -0.037    0.049   -0.744    0.457   -0.020   -0.050
  EP ~                                                                  
    OM_M      (c2)   -0.335    0.138   -2.416    0.016   -0.097   -0.097
    LEEFTIJD          0.017    0.011    1.588    0.112    0.009    0.110
    GESLACHT_         0.273    0.230    1.186    0.235    0.139    0.062
    GESLACHT_         0.840    0.391    2.146    0.032    0.427    0.027
    WERKERVAR         0.013    0.010    1.289    0.197    0.007    0.074
    RULEOBEDI        -0.069    0.052   -1.321    0.186   -0.035   -0.088
  AC ~                                                                  
    OM_M      (c3)   -0.120    0.114   -1.052    0.293   -0.036   -0.036
    LEEFTIJD          0.012    0.009    1.366    0.172    0.006    0.083
    GESLACHT_        -0.056    0.221   -0.254    0.800   -0.029   -0.013
    GESLACHT_        -1.949    2.685   -0.726    0.468   -1.015   -0.064
    WERKERVAR        -0.004    0.009   -0.451    0.652   -0.002   -0.025
    RULEOBEDI        -0.036    0.050   -0.730    0.465   -0.019   -0.047
  RES ~                                                                 
    OM_M       (a)   -1.354    0.294   -4.601    0.000   -0.309   -0.309
    LEEFTIJD         -0.009    0.010   -0.842    0.400   -0.004   -0.045
    GESLACHT_        -0.344    0.220   -1.567    0.117   -0.138   -0.061
    GESLACHT_         1.557    1.674    0.930    0.352    0.623    0.039
    WERKERVAR         0.007    0.011    0.600    0.549    0.003    0.029
    RULEOBEDI         0.247    0.061    4.025    0.000    0.099    0.249
  FC ~                                                                  
    RES       (b1)    0.412    0.135    3.040    0.002    0.553    0.553
  EP ~                                                                  
    RES       (b2)    0.298    0.130    2.295    0.022    0.379    0.379
  AC ~                                                                  
    RES       (b3)    0.309    0.104    2.978    0.003    0.402    0.402

Covariances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
 .FC ~~                                                                 
   .EP                1.864    0.433    4.303    0.000    0.717    0.717
   .AC                1.204    0.322    3.742    0.000    0.470    0.470
 .EP ~~                                                                 
   .AC                1.492    0.341    4.374    0.000    0.482    0.482
 .FC ~~                                                                 
    Marker           -0.482    0.439   -1.098    0.272   -0.239   -0.239
 .EP ~~                                                                 
    Marker           -0.403    0.433   -0.930    0.353   -0.165   -0.165
 .AC ~~                                                                 
    Marker           -0.354    0.341   -1.040    0.298   -0.147   -0.147
 .RES ~~                                                                
    Marker           -0.853    0.976   -0.874    0.382   -0.271   -0.271
  OM_M ~~                                                               
    Marker           -1.131    1.004   -1.127    0.260   -1.440   -1.440
    CLF               1.461    0.193    7.573    0.000    2.563    2.563

Intercepts:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .F1                5.484    0.583    9.403    0.000    5.484    2.637
   .F3                7.057    0.615   11.476    0.000    7.057    4.413
   .F5                6.643    0.614   10.818    0.000    6.643    3.530
   .C4                7.279    0.593   12.286    0.000    7.279    4.199
   .C5                6.662    0.623   10.693    0.000    6.662    4.115
   .E3                6.476    0.579   11.188    0.000    6.476    3.139
   .E4                6.691    0.595   11.251    0.000    6.691    3.347
   .E5                5.941    0.534   11.133    0.000    5.941    2.813
   .P5                5.678    0.561   10.117    0.000    5.678    2.360
   .A2                4.863    0.497    9.775    0.000    4.863    1.954
   .A3                3.935    0.420    9.360    0.000    3.935    1.575
   .A4                5.956    0.561   10.624    0.000    5.956    2.549
   .A5                5.108    0.551    9.267    0.000    5.108    2.063
   .RESIS1_RC         4.840    0.669    7.237    0.000    4.840    1.675
   .RESIS2_RC         3.387    0.681    4.973    0.000    3.387    1.490
   .RESIS3_RC         3.388    0.677    5.008    0.000    3.388    1.462
   .OM_M1             5.489    0.101   54.539    0.000    5.489    2.442
   .OM_M2             5.156    0.102   50.741    0.000    5.156    2.257
   .OM_M3             5.118    0.100   51.089    0.000    5.118    2.259
   .KM_gebruik_urn    1.682    0.065   25.884    0.000    1.682    1.151
   .FC                0.000                               0.000    0.000
   .EP                0.000                               0.000    0.000
   .AC                0.000                               0.000    0.000
   .RES               0.000                               0.000    0.000
    OM_M              0.000                               0.000    0.000
    CLF               0.000                               0.000    0.000
    Marker            0.000                               0.000    0.000

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
    CLF               1.000                               1.000    1.000
   .F1                2.925    0.278   10.506    0.000    2.925    0.676
   .F3                1.019    0.174    5.846    0.000    1.019    0.398
   .F5                1.988    0.369    5.391    0.000    1.988    0.561
   .C4                1.697    0.341    4.984    0.000    1.697    0.565
   .C5                1.026    0.197    5.212    0.000    1.026    0.392
   .E3                1.541    0.225    6.854    0.000    1.541    0.362
   .E4                1.157    0.195    5.934    0.000    1.157    0.290
   .E5                2.283    0.239    9.553    0.000    2.283    0.512
   .P5                3.293    0.355    9.265    0.000    3.293    0.569
   .A2                3.079    0.271   11.343    0.000    3.079    0.497
   .A3                3.991    0.281   14.214    0.000    3.991    0.640
   .A4                1.638    0.244    6.720    0.000    1.638    0.300
   .A5                2.364    0.305    7.755    0.000    2.364    0.386
   .RESIS1_RC         5.063    0.362   13.981    0.000    5.063    0.606
   .RESIS2_RC         1.238    0.231    5.354    0.000    1.238    0.239
   .RESIS3_RC         1.531    0.277    5.528    0.000    1.531    0.285
   .OM_M1             0.808    0.166    4.864    0.000    0.808    0.160
   .OM_M2             1.088    0.210    5.187    0.000    1.088    0.209
   .OM_M3             1.204    0.216    5.568    0.000    1.204    0.234
   .KM_gebruik_urn    0.000                               0.000    0.000
   .FC                2.148    0.460    4.671    0.000    0.621    0.621
   .EP                3.147    0.476    6.604    0.000    0.813    0.813
   .AC                3.051    0.412    7.399    0.000    0.827    0.827
   .RES               5.214    1.710    3.049    0.002    0.835    0.835
    OM_M              0.325    0.375    0.866    0.387    1.000    1.000
    Marker            1.899    0.404    4.703    0.000    0.889    0.889

Defined Parameters:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
    ab1              -0.558    0.290   -1.926    0.054   -0.171   -0.171
    ab2              -0.404    0.252   -1.604    0.109   -0.117   -0.117
    ab3              -0.418    0.218   -1.922    0.055   -0.124   -0.124

> inspect(fit.CMB.marker, "cov.lv")
       FC     EP     AC     RES    OM_M   CLF    Marker
FC      3.460                                          
EP      2.786  3.872                                   
AC      2.084  2.127  3.688                            
RES     2.690  1.894  1.911  6.243                     
OM_M   -0.340 -0.240 -0.175 -0.440  0.325              
CLF    -1.531 -1.078 -0.787 -1.978  1.461  1.000       
Marker -0.393 -0.347 -0.391 -0.283 -0.421  0.486  2.136
> CMB.marker <- '
+ #define DVs
+ FC =~ F1 + F3 + F5 + C4 + C5
+ EP =~ E3 + E4 + E5 + P5
+ AC =~ A2 + A3 + A4 + A5
+ #define M
+ RES =~ RESIS1_RC + RESIS2_RC + RESIS3_RC
+ #define IV
+ OM_M =~ OM_M1 + OM_M2 + OM_M3 
+ #covariances DV (all measure 1 dimension of inspection style)
+ FC ~~ EP
+ FC ~~ AC
+ AC ~~ EP
+ #direct effect
+ FC ~ c1*OM_M + LEEFTIJD + RULEOBEDIENCE
+ EP ~ c2*OM_M + LEEFTIJD + WERKERVARING 
+ AC ~ c3*OM_M + LEEFTIJD + GESLACHT_D_VROUW 
+ #mediation b/w IV and 3 DV 
+ #indirect effects
+ RES ~ a*OM_M + RULEOBEDIENCE #only rule obedience correlated with resistance
+ FC ~ b1*RES 
+ EP ~ b2*RES 
+ AC ~ b3*RES 
+ ab1 := a*b1
+ ab2 := a*b2
+ ab3 := a*b3 
+ #define common latent variable
+ #constraining factor loadings to be equal
+ CLF =~ F1 + cmb*F3 + cmb*F5 + cmb*C4 + cmb*C5 +
+        cmb*E3 + cmb*E4 + cmb*E5 + cmb*P5 +
+        cmb*A2 + cmb*A3 + cmb*A4 + cmb*A5 +
+        cmb*RESIS1_RC + cmb*RESIS2_RC + cmb*RESIS3_RC +
+        cmb*OM_M1 + cmb*OM_M2 + cmb*OM_M3 +
+        Marker
+     
+ #contraining variance of CLF to be 1
+ CLF ~~ 1*CLF
+ #adding marker variable: KM_gebruik_uren
+ #constraining factor loadings to be equal
+ Marker =~ cmb*KM_gebruik_uren
+ #covary with other latent variables
+ Marker ~~ FC
+ Marker ~~ EP
+ Marker ~~ AC
+ Marker ~~ RES
+ Marker ~~ OM_M
+ '
> fit.CMB.marker <- cfa(CMB.marker, 
+                      data = NVWA2016, 
+                      estimator="MLM")
Warning message:
In lav_object_post_check(object) :
  lavaan WARNING: covariance matrix of latent variables
                is not positive definite;
                use inspect(fit,"cov.lv") to investigate.
> summary(fit.CMB.marker, standardized=TRUE, fit.measures=TRUE)
lavaan (0.5-23.1097) converged normally after 149 iterations

  Number of observations                           507

  Estimator                                         ML      Robust
  Minimum Function Test Statistic              596.408     508.883
  Degrees of freedom                               227         227
  P-value (Chi-square)                           0.000       0.000
  Scaling correction factor                                  1.172
    for the Satorra-Bentler correction

Model test baseline model:

  Minimum Function Test Statistic             5165.641    2777.151
  Degrees of freedom                               270         270
  P-value                                        0.000       0.000

User model versus baseline model:

  Comparative Fit Index (CFI)                    0.925       0.888
  Tucker-Lewis Index (TLI)                       0.910       0.866

  Robust Comparative Fit Index (CFI)                         0.929
  Robust Tucker-Lewis Index (TLI)                            0.916

Loglikelihood and Information Criteria:

  Loglikelihood user model (H0)             -25079.037  -25079.037
  Loglikelihood unrestricted model (H1)     -24780.834  -24780.834

  Number of free parameters                         83          83
  Akaike (AIC)                               50324.075   50324.075
  Bayesian (BIC)                             50675.041   50675.041
  Sample-size adjusted Bayesian (BIC)        50411.589   50411.589

Root Mean Square Error of Approximation:

  RMSEA                                          0.057       0.049
  90 Percent Confidence Interval          0.051  0.062       0.044  0.055
  P-value RMSEA <= 0.05                          0.024       0.555

  Robust RMSEA                                               0.054
  90 Percent Confidence Interval                             0.047  0.060

Standardized Root Mean Square Residual:

  SRMR                                           0.050       0.050

Parameter Estimates:

  Information                                 Expected
  Standard Errors                           Robust.sem

Latent Variables:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  FC =~                                                                 
    F1                1.000                               1.636    0.785
    F3                1.042    0.051   20.467    0.000    1.705    1.061
    F5                1.044    0.065   15.987    0.000    1.707    0.906
    C4                0.969    0.061   15.773    0.000    1.585    0.910
    C5                1.057    0.055   19.272    0.000    1.730    1.065
  EP =~                                                                 
    E3                1.000                               1.816    0.876
    E4                1.029    0.043   23.748    0.000    1.869    0.930
    E5                0.878    0.054   16.155    0.000    1.594    0.753
    P5                0.942    0.055   17.008    0.000    1.711    0.712
  AC =~                                                                 
    A2                1.000                               1.755    0.707
    A3                0.817    0.058   14.192    0.000    1.434    0.575
    A4                1.150    0.069   16.639    0.000    2.019    0.863
    A5                1.152    0.073   15.780    0.000    2.021    0.812
  RES =~                                                                
    RESIS1_R          1.000                               2.318    0.800
    RESIS2_R          1.072    0.056   19.245    0.000    2.485    1.094
    RESIS3_R          1.053    0.059   17.889    0.000    2.442    1.058
  OM_M =~                                                               
    OM_M1             1.000                               0.827    0.366
    OM_M2             0.952    0.059   16.162    0.000    0.787    0.345
    OM_M3             0.889    0.061   14.566    0.000    0.735    0.326
  CLF =~                                                                
    F1                1.000                               1.000    0.480
    F3       (cmb)    1.000                               1.000    0.622
    F5       (cmb)    1.000                               1.000    0.531
    C4       (cmb)    1.000                               1.000    0.574
    C5       (cmb)    1.000                               1.000    0.616
    E3       (cmb)    1.000                               1.000    0.483
    E4       (cmb)    1.000                               1.000    0.498
    E5       (cmb)    1.000                               1.000    0.473
    P5       (cmb)    1.000                               1.000    0.416
    A2       (cmb)    1.000                               1.000    0.403
    A3       (cmb)    1.000                               1.000    0.401
    A4       (cmb)    1.000                               1.000    0.427
    A5       (cmb)    1.000                               1.000    0.402
    RESIS1_R (cmb)    1.000                               1.000    0.345
    RESIS2_R (cmb)    1.000                               1.000    0.440
    RESIS3_R (cmb)    1.000                               1.000    0.433
    OM_M1    (cmb)    1.000                               1.000    0.443
    OM_M2    (cmb)    1.000                               1.000    0.438
    OM_M3    (cmb)    1.000                               1.000    0.443
    Marker            0.432    0.328    1.319    0.187    0.296    0.296
  Marker =~                                                             
    KM_gbrk_ (cmb)    1.000                               1.461    1.000

Regressions:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  FC ~                                                                  
    OM_M      (c1)   -0.558    0.125   -4.479    0.000   -0.282   -0.282
    LEEFTIJD          0.011    0.008    1.433    0.152    0.007    0.088
    RULEOBEDI         0.014    0.027    0.502    0.616    0.008    0.021
  EP ~                                                                  
    OM_M      (c2)   -0.423    0.128   -3.304    0.001   -0.193   -0.193
    LEEFTIJD          0.007    0.009    0.782    0.434    0.004    0.051
    WERKERVAR         0.023    0.007    3.246    0.001    0.013    0.142
  AC ~                                                                  
    OM_M      (c3)   -0.175    0.108   -1.623    0.105   -0.083   -0.083
    LEEFTIJD          0.009    0.007    1.202    0.230    0.005    0.063
    GESLACHT_        -0.204    0.184   -1.108    0.268   -0.116   -0.052
  RES ~                                                                 
    OM_M       (a)   -1.152    0.199   -5.788    0.000   -0.411   -0.411
    RULEOBEDI         0.245    0.060    4.077    0.000    0.106    0.266
  FC ~                                                                  
    RES       (b1)    0.259    0.103    2.516    0.012    0.366    0.366
  EP ~                                                                  
    RES       (b2)    0.143    0.095    1.514    0.130    0.183    0.183
  AC ~                                                                  
    RES       (b3)    0.195    0.077    2.535    0.011    0.257    0.257

Covariances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
 .FC ~~                                                                 
   .EP                1.563    0.354    4.417    0.000    0.681    0.681
   .AC                0.961    0.248    3.883    0.000    0.426    0.426
 .EP ~~                                                                 
   .AC                1.228    0.268    4.574    0.000    0.436    0.436
 .FC ~~                                                                 
    Marker           -0.521    0.438   -1.190    0.234   -0.275   -0.275
 .EP ~~                                                                 
    Marker           -0.471    0.440   -1.071    0.284   -0.200   -0.200
 .AC ~~                                                                 
    Marker           -0.370    0.333   -1.113    0.266   -0.159   -0.159
 .RES ~~                                                                
    Marker           -0.639    0.734   -0.871    0.384   -0.227   -0.227
  OM_M ~~                                                               
    Marker           -0.937    0.776   -1.208    0.227   -0.812   -0.812
    CLF               1.313    0.138    9.495    0.000    1.588    1.588

Intercepts:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .F1                5.669    0.444   12.766    0.000    5.669    2.720
   .F3                7.241    0.471   15.366    0.000    7.241    4.505
   .F5                6.829    0.471   14.511    0.000    6.829    3.623
   .C4                7.467    0.453   16.499    0.000    7.467    4.285
   .C5                6.846    0.477   14.338    0.000    6.846    4.215
   .E3                6.519    0.458   14.238    0.000    6.519    3.146
   .E4                6.727    0.471   14.289    0.000    6.727    3.347
   .E5                5.997    0.417   14.392    0.000    5.997    2.834
   .P5                5.736    0.438   13.091    0.000    5.736    2.387
   .A2                4.831    0.404   11.970    0.000    4.831    1.946
   .A3                3.920    0.339   11.572    0.000    3.920    1.572
   .A4                5.896    0.466   12.645    0.000    5.896    2.520
   .A5                5.041    0.461   10.935    0.000    5.041    2.026
   .RESIS1_RC         4.448    0.489    9.103    0.000    4.448    1.535
   .RESIS2_RC         2.966    0.470    6.311    0.000    2.966    1.306
   .RESIS3_RC         2.986    0.464    6.432    0.000    2.986    1.294
   .OM_M1             5.489    0.101   54.539    0.000    5.489    2.430
   .OM_M2             5.156    0.102   50.741    0.000    5.156    2.259
   .OM_M3             5.118    0.100   51.089    0.000    5.118    2.269
   .KM_gebruik_urn    1.682    0.065   25.884    0.000    1.682    1.151
   .FC                0.000                               0.000    0.000
   .EP                0.000                               0.000    0.000
   .AC                0.000                               0.000    0.000
   .RES               0.000                               0.000    0.000
    OM_M              0.000                               0.000    0.000
    CLF               0.000                               0.000    0.000
    Marker            0.000                               0.000    0.000

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
    CLF               1.000                               1.000    1.000
   .F1                2.918    0.278   10.512    0.000    2.918    0.672
   .F3                1.021    0.174    5.860    0.000    1.021    0.395
   .F5                1.985    0.371    5.353    0.000    1.985    0.559
   .C4                1.703    0.342    4.985    0.000    1.703    0.561
   .C5                1.024    0.200    5.128    0.000    1.024    0.388
   .E3                1.542    0.228    6.761    0.000    1.542    0.359
   .E4                1.136    0.197    5.757    0.000    1.136    0.281
   .E5                2.294    0.239    9.589    0.000    2.294    0.512
   .P5                3.304    0.356    9.282    0.000    3.304    0.572
   .A2                3.130    0.276   11.340    0.000    3.130    0.508
   .A3                4.016    0.279   14.393    0.000    4.016    0.646
   .A4                1.604    0.249    6.452    0.000    1.604    0.293
   .A5                2.313    0.318    7.278    0.000    2.313    0.374
   .RESIS1_RC         5.049    0.365   13.836    0.000    5.049    0.601
   .RESIS2_RC         1.228    0.240    5.128    0.000    1.228    0.238
   .RESIS3_RC         1.547    0.276    5.609    0.000    1.547    0.291
   .OM_M1             0.792    0.173    4.592    0.000    0.792    0.155
   .OM_M2             1.094    0.215    5.092    0.000    1.094    0.210
   .OM_M3             1.213    0.219    5.547    0.000    1.213    0.238
   .KM_gebruik_urn    0.000                               0.000    0.000
   .FC                1.840    0.382    4.819    0.000    0.688    0.688
   .EP                2.863    0.413    6.930    0.000    0.868    0.868
   .AC                2.773    0.366    7.570    0.000    0.900    0.900
   .RES               4.086    0.811    5.035    0.000    0.760    0.760
    OM_M              0.684    0.273    2.504    0.012    1.000    1.000
    Marker            1.949    0.328    5.935    0.000    0.913    0.913

Defined Parameters:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
    ab1              -0.298    0.155   -1.917    0.055   -0.151   -0.151
    ab2              -0.165    0.128   -1.285    0.199   -0.075   -0.075
    ab3              -0.224    0.115   -1.952    0.051   -0.106   -0.106

> inspect(fit.CMB.marker, "cov.lv")
       FC     EP     AC     RES    OM_M   CLF    Marker
FC      2.675                                          
EP      2.114  3.297                                   
AC      1.447  1.553  3.081                            
RES     1.855  1.112  1.191  5.375                     
OM_M   -0.586 -0.402 -0.273 -0.788  0.684              
CLF    -1.124 -0.773 -0.525 -1.513  1.313  1.000       
Marker -0.370 -0.345 -0.347 -0.213 -0.370  0.432  2.136

I do not get why and how to fix this. Can anyone help me?

Best,
Noortje

Terrence Jorgensen

unread,
Apr 5, 2017, 4:56:01 AM4/5/17
to lavaan
I indeed find negative covariances between my latent variables

Negative covariances are not an indication of a nonpositive definite matrix.  Negative variances are (you have none of those) and out-of-bounds correlations are (i.e., > +/-1).  You can check for out-of-bounds correlations with lavInspect(fit, "cor.lv").  But you can have a NPD matrix even if neither of those particular "Heywood cases" are present.  If your variances and correlations are all within their natural boundaries, then your NPD matrix could have linear dependencies (redundancies, conceptually).  

I do not get why and how to fix this. Can anyone help me?

NPD matrices can be due to sampling error, or due to model misspecification.  
  • To investigate whether misspecification is a plausible explanation, you can test the fit of your model(s).  To narrow down the source of misspecification, you can first fit a CFA.  Since the latent structure is saturated, all misfit is due to misspecification in the measurement model.  You may have to reconceptualize the measurement model before proceeding to test hypotheses about the latent constructs your hope are represented by your measurement model.  After establishing satisfactory fit in your CFA, then you can test the structural hypotheses by comparing the fit of the latent regression model to the CFA model.  Any decrement in fit will be due to imposing structural constraints.  This is sometimes called "the 2-step approach", and you can find more about it in the literature or by asking around on SEMNET.
  • To investigate whether sampling error is a plausible explanation, you can check whether the 95% CI of an out-of-bounds estimate includes plausible values.  If you find a correlation > 1, you can transform the lower confidence limit of the covariance estimate into a correlation metric by dividing by its respective SDs.  http://journals.sagepub.com/doi/abs/10.1177/0049124112442138

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



Reply all
Reply to author
Forward
0 new messages