Not showing GOF results on Mediation Path Analysis with controlling variables

20 views
Skip to first unread message

Andrés González

unread,
May 20, 2019, 7:26:12 PM5/20/19
to lavaan
Hi, 

When i try to run a model to test a mediation effect of a variable called vulnerability (vul), but controlling on socioeconomic (gse_ac3) and economical tightness (estrechez), somehow my model stop showing GOF's

modelo_simple2 <- "# direct effect
             k6_2 ~ c*vul + gse_ac3 + estrechez
             # mediator
             NAQ_sum ~ a*vul + gse_ac3 + estrechez
             k6_2 ~ b*NAQ_sum
             #indirect effect (a*b)
             ab := a*b
             total effect:= c + (a*b)
             "
set.seed(1234)
SEM2 <- sem(modelo_simple2, data=BD_13_02_19, estimator="MLR")
semPaths(SEM2, what="paths", whatLabels="par", layout="tree", thresholds=F, intercepts=F)
summary(SEM2, fit.measures=TRUE, standardize=TRUE, rsquare=TRUE)
fitMeasures(SEM2)
ajusteAFC(SEM2)

 Optimization method                           NLMINB
  Number of free parameters                          9
                                                  Used       Total
  Number of observations                          1914        1995
  Estimator                                         ML      Robust
  Model Fit Test Statistic                       0.000       0.000
  Degrees of freedom                                 0           0
  Minimum Function Value               0.0000000000000
  Scaling correction factor                                     NA
    for the Yuan-Bentler correction (Mplus variant)
Model test baseline model:
  Minimum Function Test Statistic              685.079     476.844
  Degrees of freedom                                 7           7
  P-value                                        0.000       0.000
User model versus baseline model:
  Comparative Fit Index (CFI)                    1.000       1.000
  Tucker-Lewis Index (TLI)                       1.000       1.000
  Robust Comparative Fit Index (CFI)                            NA
  Robust Tucker-Lewis Index (TLI)                               NA


What i'm trying to find if the effect of vulnerability over k2 (psychollogical distress scores) and the mediating effect (Workplace Violence scores), controlling on these 2 variables.  Unfortunatedly, i only get results from this model: 

modelo_simple2 <- "# direct effect
             k6_2 ~ c*vul
             # mediator
             NAQ_sum ~ a*vul + gse_ac3 + estrechez
             k6_2 ~ b*NAQ_sum
             #indirect effect (a*b)
             ab := a*b
             total effect:= c + (a*b)

 lavaan 0.6-3 ended normally after 46 iterations
  Optimization method                           NLMINB
  Number of free parameters                          7
                                                  Used       Total
  Number of observations                          1914        1995
  Estimator                                         ML      Robust
  Model Fit Test Statistic                      23.972      21.018
  Degrees of freedom                                 2           2
  P-value (Chi-square)                           0.000       0.000
  Scaling correction factor                                  1.141
    for the Yuan-Bentler correction (Mplus variant)
Model test baseline model:
  Minimum Function Test Statistic              685.079     476.844
  Degrees of freedom                                 7           7
  P-value                                        0.000       0.000
User model versus baseline model:
  Comparative Fit Index (CFI)                    0.968       0.960
  Tucker-Lewis Index (TLI)                       0.887       0.858
  Robust Comparative Fit Index (CFI)                         0.968
  Robust Tucker-Lewis Index (TLI)                            0.888

Is there a problem on how I'm specifying the variables?


Rplot.jpeg
incorrect model.jpeg

Andrés González

unread,
May 20, 2019, 7:30:00 PM5/20/19
to lavaan
What literature says is that these covariates (estrechez and gse_ac3) may have confounding effects on the relation of vulnerability over distress, and over the mediating relationship of vulnerability over workplace violence.

Terrence Jorgensen

unread,
May 22, 2019, 2:41:27 AM5/22/19
to lavaan
somehow my model stop showing GOF's

Because the model is saturated (all possible bivariate relationships are estimated as covariances or as slopes).  The model with 2 df omits 2 paths on the mediator.

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

Andrés González

unread,
May 22, 2019, 8:20:47 AM5/22/19
to lavaan
Thank you so much Mr Terrence. What do you mean precisely when you say "The model with 2 df omits 2 paths on the mediator.", ¿should I incorporate these paths on the mediator?, ¿is it wrong to have only two degrees of freedom?
Kind regards, 

Terrence Jorgensen

unread,
May 23, 2019, 4:22:32 AM5/23/19
to lavaan
What do you mean precisely when you say "The model with 2 df omits 2 paths on the mediator.", ¿should I incorporate these paths on the mediator?, ¿is it wrong to have only two degrees of freedom?

 Here is an introductory text on SEM.  


There are plenty of others available.
Reply all
Reply to author
Forward
0 new messages