i ran a model in AMOS and re-run the same model in lavaan, but getting different dfs. In AMOS I get df = 108, and in lavaan, I get df = 111.
Just trying to figure out what three other parameters are being estimated in AMOS that are not being done in lavaan. any help is appreciated
attached is a graphical representation of the model estimated in AMOS (without the observed variables), which will be indicated in the lavaan code below:
AMOS Summary
summary of the AMOS output is below (focusing on variables and model fit - default model)
number
of variables in your model |
54 |
|
|
|
number of
observed variables |
17 |
|
|
|
number of
unobserved variables |
37 |
|
|
|
number of
exogenous variables |
27 |
|
|
|
number of
endogenous variables |
27 |
|
|
|
|
|
|
|
|
MODEL |
npar |
CMIN |
df |
p |
default model |
62 |
2135.78 |
108 |
0.000 |
lavaan Code
#specifying the model
model <- '
#measurement (latent factor ) model
TC =~ CO + TR
E =~ EM
GD =~ GR
TMS =~ EN + CON
C =~ COM1 + COM2
S =~ SA
PWE =~ EN + SU
TWM =~ TR1 + TR + TM
JS =~ RE
EC =~ RE1 + RE2
#structural model (regressions)
#direct effects
E ~ a1*TC
GD ~ a2*E
JS ~ a3*GD
C ~ b1*TMS
PWE ~ b2*C
TWM ~ b3*PWE
JS ~ b4*TWM
PWE ~ c1*S
EC ~ d1*JS
'
#fitting the sem
fit <- sem(model,
data = ltestR, warn = TRUE, meanstructure = TRUE,
mimic = "EQS", estimator = "ML")
lavaan goodness of fit
Estimator ML
Model Fit Test Statistic 3312.865
Degrees of freedom 111
P-value (Chi-square) 0.000