Multiple mediation with latent variables

108 views
Skip to first unread message

MarlonEsmeyer

unread,
Jun 16, 2018, 5:09:11 PM6/16/18
to lavaan

I am trying to figure out a SEM with latent variables and 2 mediators. The data is imported from SPSS and all the Variables in the data (here called x1, x2, m1...) are z-standardized.

The model looks like this:

 

I wrote the following syntax:

model <- '
              #latent variables

              X =~ x1 + x2

              M =~ m1 + m2

              N =~ n1 + n2

              Y =~ y1 + y2 + y3

              #regressions

              Y ~ M + N

              M ~ X

              N ~ X '


 

fit
<- sem(model, data = data, likelihood = "wishart")

summary
(fit, standardized=T)



The results I got in lavaan are different to the results my professor got in AMOS. This is the case for all path coefficients as well as the coefficients of the latent variables and the variances.

The differences between the values are not too big (0.01-0.1) and the degrees of freedom (23) are also the same in AMOS, so my model can’t be completely wrong.

Does anyone know, where my problem is? Is there something wrong with my model or does AMOS calculate it in a different manner? And if the second is the case: Is it possible to calculate it like it is calculated in AMOS? I already used the “wishart”-command, which is enough in easy models to get the same results like in AMOS for the chi-squared statistics.

I would be very grateful for help.

 

Thanks in andvance,

Marlon.
Auto Generated Inline Image 1

Jeremy Miles

unread,
Jun 21, 2018, 12:35:28 PM6/21/18
to lav...@googlegroups.com
Are your fit indicies the same?

Which parameters vary? Sometimes different programs use different constraints to identify the model. 

Do you have any missing data? Are the sample sizes the same?






--
You received this message because you are subscribed to the Google Groups "lavaan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lavaan+un...@googlegroups.com.
To post to this group, send email to lav...@googlegroups.com.
Visit this group at https://groups.google.com/group/lavaan.
For more options, visit https://groups.google.com/d/optout.
--
--
My employer has nothing to do with this email. 

Yves Rosseel

unread,
Jun 22, 2018, 5:15:11 AM6/22/18
to lav...@googlegroups.com
> The results I got in lavaan are different to the results my professor
> got in AMOS.

Could you show us the AMOS output? (and lavaan output)? Do you have
missing data? Try missing = "ml" in lavaan.

If you provide us with the data, we can investigate.

Yves.

MarlonEsmeyer

unread,
Jun 28, 2018, 1:10:12 PM6/28/18
to lavaan

The fit indices are also different. Although the sample size is the same and there is no missing data.

 

Here the Output in Amos:

(http://www3.hogrefe.de/fileadmin/redakteure/hogrefe_de/Psychlehrbuchplus/Multivariate_Verfahren/10_Lineare_Strukturgleichungsmod/Ressourcen.pdf)


My Syntax:


model <- '
          #latent variables
          Belastung =~ stresarb + alltbela
          Selbstwirksamkeit =~ selbskf + kohärenz
          Ärgerausdruck =~ angeout + ungeduld
          Befinden =~ deprvers + klimabes + psywohl

          #regressions
          Befinden ~ Selbstwirksamkeit
          Befinden ~ Ärgerausdruck
          Selbstwirksamkeit ~ Belastung
          Ärgerausdruck ~ Belastung
          '


fit
<- sem(modell, data = data, likelihood = "wishart")
summary
(fit, standardized=T, fit.measures=T)

And here the output in lavaan:



lavaan (0.6-1) converged normally after  44 iterations

  Number of observations                           198

  Estimator                                         ML
  Model Fit Test Statistic                      45.060
  Degrees of freedom                                23
  P-value (Chi-square)                           0.004

Model test baseline model:

  Minimum Function Test Statistic              597.111
  Degrees of freedom                                36
  P-value                                        0.000

User model versus baseline model:

  Comparative Fit Index (CFI)                    0.961
  Tucker-Lewis Index (TLI)                       0.938

Loglikelihood and Information Criteria:

  Loglikelihood user model (H0)              -2247.058
  Loglikelihood unrestricted model (H1)      -2224.413

  Number of free parameters                         22
  Akaike (AIC)                                4538.115
  Bayesian (BIC)                              4610.457
  Sample-size adjusted Bayesian (BIC)         4540.761

Root Mean Square Error of Approximation:

  RMSEA                                          0.070
  90 Percent Confidence Interval          0.039  0.100
  P-value RMSEA <= 0.05                          0.133

Standardized Root Mean Square Residual:

  SRMR                                           0.045

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
  Belastung =~                                                              
    stresarb              1.000                               0.382    0.382
    alltbela              1.439    0.328    4.389    0.000    0.550    0.550
  Selbstwirksamkeit =~                                                      
    selbskf               1.000                               0.707    0.707
    kohärenz              1.025    0.111    9.209    0.000    0.724    0.724
  Ärgerausdruck =~                                                          
    angeout               1.000                               0.617    0.625
    ungeduld              1.269    0.218    5.811    0.000    0.783    0.789
  Befinden =~                                                               
    deprvers              1.000                               0.816    0.815
    klimabes              0.682    0.089    7.695    0.000    0.556    0.556
    psywohl              -0.958    0.084  -11.337    0.000   -0.781   -0.781

Regressions:
                      Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  Befinden ~                                                               
    Selbstwirksmkt      -1.197    0.189   -6.331    0.000   -1.038   -1.038
    Ärgerausdruck       -0.108    0.179   -0.604    0.546   -0.082   -0.082
  Selbstwirksamkeit ~                                                      
    Belastung           -1.761    0.420   -4.194    0.000   -0.952   -0.952
  Ärgerausdruck ~                                                          
    Belastung            1.138    0.296    3.840    0.000    0.704    0.704

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .stresarb          0.854    0.090    9.437    0.000    0.854    0.854
   .alltbela          0.698    0.084    8.281    0.000    0.698    0.698
   .selbskf           0.500    0.062    8.065    0.000    0.500    0.500
   .kohärenz          0.475    0.061    7.820    0.000    0.475    0.475
   .angeout           0.593    0.084    7.105    0.000    0.593    0.609
   .ungeduld          0.371    0.101    3.671    0.000    0.371    0.377
   .deprvers          0.335    0.051    6.592    0.000    0.335    0.335
   .klimabes          0.691    0.075    9.226    0.000    0.691    0.691
   .psywohl           0.390    0.053    7.348    0.000    0.390    0.390
    Belastung         0.146    0.059    2.456    0.014    1.000    1.000
   .Selbstwirksmkt    0.047    0.067    0.701    0.483    0.094    0.094
   .Ärgerausdruck     0.192    0.060    3.178    0.001    0.504    0.504
   .Befinden          0.020    0.054    0.367    0.714    0.030    0.030


Basically all parameters vary. And the output in lavaan does not really make sense to me (i.e. the path coefficient of -1.038 between Selbstwirksamkeit and Befinden).

Do you have any suggestions?

Thanks again,
Marlon
Auto Generated Inline Image 1

Yves Rosseel

unread,
Jul 30, 2018, 1:46:39 PM7/30/18
to lav...@googlegroups.com
On 06/28/2018 07:10 PM, MarlonEsmeyer wrote:
> Basically all parameters vary. And the output in lavaan does not really
> make sense to me (i.e. the path coefficient of -1.038 between
> Selbstwirksamkeit and Befinden).

That does not seem too far away from the -0.95 reported by AMOS.

> Do you have any suggestions?

I tried running this with Mplus (output in attach), and I got the same
results as lavaan (when you remove the likelihood = "Wishart" argument).

I have no access to AMOS to run this myself, but I wonder if they used
all cases. Are the sample mean and the sample covariance matrix reported
by AMOS the same as the ones reported by Mplus/lavaan?

Yves.
mplus.txt

MarlonEsmeyer

unread,
Sep 8, 2018, 6:58:36 AM9/8/18
to lavaan
 I spoke again with my professor and he checked the Amos-results another time. There was a mistake in the publisher's text. They used an asymptomatic, distribution-free method. So in the end my results and your results in Mplus are correct.

Sorry for the inconvenience and thanks a lot for your effort.

Marlon
Reply all
Reply to author
Forward
0 new messages