I need to determine both the
number of free parameters to estimate and
degrees of freedom
of a structural equation model. I know how to calculate these values by hand. However, when I use the R package lavaan
, I get a different number. I calculate 59 parameters to estimate.
library(lavaan) modelo1 <- ' ST ~ A*PA + B*MT+C*INF PA=~CP127_1+CP127_2+CP127_3+CP127_4+CP127_5+CP127_6 MT=~CP128_1+CP128_2+CP128_3+CP128_4+CP128_5+CP128_6 INF=~CP138_1+CP138_2+CP138_3+CP138_4+CP138_5+CP138_6+CP138_7+CP138_8 ST=~CP139_1+CP139_2+CP139_3+CP139_4+CP139_5+CP139_6' ajuste1 <- sem(modelo1,data=dataof,ordered =TRUE) summary(fit.measures=TRUE,ajuste1)
lavaan (0.5-23.1097) converged normally after 65 iterations Number of observations 416 Estimator DWLS Robust Minimum Function Test Statistic 375.660 555.434 Degrees of freedom 293 293 P-value (Chi-square) 0.001 0.000 Scaling correction factor 0.977 Shift parameter 170.951 for simple second-order correction (Mplus variant)
Best Answer
The total number of elements in your initial covariance matrix is k(k+1)/2 where k = the number of variables in the matrix. In this case, that gives you (26*27)/2 = 351. In terms of the number of parameters that you have to estimate in the model, you have 26 observed variable variances, 22 loadings, 4 latent variable variances, 3 regression paths, and 3 latent variable covariances. Add those up and you have 58 not 59 free parameters to estimate in the model. 351-58 = 293 degrees of freedom.
Similar Posts:
- Solved – Determine the degrees of freedom as well as the free parameters in an SEM using software
- Solved – Degrees of Freedom in CFA using lavaan
- Solved – identification SEM model
- Solved – SEM model in lavaan: Can’t compute standard errors
- Solved – lavaan works with `cfa`, provides error with lavaan(method = ‘cfa’)