 #### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

# SEM. Failing calculation

Hello JASP Team!

I have a question to evankesteren.

I performed a mediation analysis with 1 IV, 1 DV and 6 mediators. Everything looks good:

I copied lavaan syntaxes into SEM

Model syntax

# ---------------------------------

# Mediation model generated by JASP

# ---------------------------------

# dependent regression

RESIL ~ b11*SE + b12*LOT + b13*SC + b14*CS + b15*BU + b16*STS + c11*PSS

# mediator regression

SE ~ a11*PSS

LOT ~ a21*PSS

SC ~ a31*PSS

CS ~ a41*PSS

BU ~ a51*PSS

STS ~ a61*PSS

# mediator residual covariance

SE ~~ LOT

SE ~~ SC

LOT ~~ SC

SE ~~ CS

LOT ~~ CS

SC ~~ CS

SE ~~ BU

LOT ~~ BU

SC ~~ BU

CS ~~ BU

SE ~~ STS

LOT ~~ STS

SC ~~ STS

CS ~~ STS

BU ~~ STS

# effect decomposition

# y1 ~ x1

ind_x1_m1_y1 := a11*b11

ind_x1_m2_y1 := a21*b12

ind_x1_m3_y1 := a31*b13

ind_x1_m4_y1 := a41*b14

ind_x1_m5_y1 := a51*b15

ind_x1_m6_y1 := a61*b16

ind_x1_y1 := ind_x1_m1_y1 + ind_x1_m2_y1 + ind_x1_m3_y1 + ind_x1_m4_y1 + ind_x1_m5_y1 + ind_x1_m6_y1

tot_x1_y1 := ind_x1_y1 + c11

Then all calculations are went wrong: the model shows zero degrees of freedom

All additional fit measurements also strange (including no difference between H0 and H1 models

And Path diagram came with error:

I performed this analysis on both raw and mean centred data. The errors and outputs in SEM are the same.

I would greatly appreciate if you could have a look into this problem. My initial thoughts that the model could not converge... But, I am not sure how to deal with this.

I attached my dataset.

Thank you very much in advance!

Best wishes,

alla

• edited October 2020

Hi @AllaY (cc'd @evankesteren),

Thank you for reporting this error! I see that you first performed Mediation Analysis. Then, you copied the lavaan syntax produced from JASP and feed it to the lavaan syntax for Structural Equation Modeling (if I understood your situation, correctly).

1. Path Diagram Issue

I indeed see that the Path Diagram does not work. When I tried to plot the path diagram using the same lavaan syntax but with the function semPaths() in the R semPlot package, it worked. I also check that only the last two lines, that is, "ind_x1_y1 := ind_x1_m1_y1 + ind_x1_m2_y1 + ind_x1_m3_y1 + ind_x1_m4_y1 + ind_x1_m5_y1 + ind_x1_m6_y1" and "tot_x1_y1 := ind_x1_y1 + c11" are problematic since the Path Diagram is plotted if you exclude both two lines.

2. Model Fit Issue

I think the model fits are not strange because the model is saturated. That is, the number of free parameters (15 covariances among mediators, 1 variance of the predictor, 13 regression coefficients, 7 residual variances, so in total, 36; I excluded 1 mean of the predictor variable and 7 intercepts of the mediators and the outcome variable since means are centered in the data) is equal to the number of samples statistics (8 means and 28 variances/covariances, so in total, 36), which result in the degrees of freedom 0. Please note that the JASP might say there are 35 free parameters, but this should be 36 since the variance of the predictor (PSS ~~ PSS) should be included in the model syntax.

For the path diagram issue, we will figure out the cause of the problem!

Cheers,

Ihnwhi