Hello, all,
I have quick question about the way that the lavaan package calculates the degrees of freedom for the chi-square tests (i.e., "model test user model" and "model test baseline"). Below is a dummy model that I created to try and understand the way that lavaan calculates the degrees of freedom for the tests; it is not theoretical or practical in nature.
--------------------------
model <- "
#Structural Equations
Commit_Summed_T2 ~ Commit_Summed_T1
Burnout_Summed_T2 ~ Burnout_Summed_T1
# Residual Covariances
Commit_Summed_T2 ~~ Burnout_Summed_T2"
lavaan::sem(model = model,
data = main_dataset) -> fit
fit %>%
summary(fit.measures = T,
standardized = T)
----------------------------
According to this model, there are 2 regression pathways, 2 residual covariances (automatically estimated by the sem function), and 1 residual covariance (i.e., 5 free parameters). According to my calculations, the chi-square test should report 5 degrees of freedom.
[4 (4 + 1)]/2 = 10 (covariances and variances)
10 - 5 [freely estimated parameters; see above] = 5 DF
However, the software reports 2 DF for the chi-square test (see output below), even though it does corroborate the 5 "free parameters". As for the baseline model, I am generally unsure what lavaan considers to be the baseline model; more information would be helpful, since I cannot seem to find any resources explaining this section of the output and "baseline models' can vary between software.
R Output:
lavaan 0.6.15 ended normally after 12 iterations
Estimator ML
Optimization method NLMINB
Number of model parameters 5
Number of observations 262
Model Test User Model:
Test statistic 18.600
Degrees of freedom 2
P-value (Chi-square) 0.000
Model Test Baseline Model:
Test statistic 518.189
Degrees of freedom 5
P-value 0.000
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.968
Tucker-Lewis Index (TLI) 0.919
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -1339.918
Loglikelihood unrestricted model (H1) -1330.618
Akaike (AIC) 2689.836
Bayesian (BIC) 2707.678
Sample-size adjusted Bayesian (SABIC) 2691.825
Root Mean Square Error of Approximation:
RMSEA 0.178
90 Percent confidence interval - lower 0.110
90 Percent confidence interval - upper 0.256
P-value H_0: RMSEA <= 0.050 0.002
P-value H_0: RMSEA >= 0.080 0.989
Standardized Root Mean Square Residual:
SRMR 0.076
Parameter Estimates:
Standard errors Standard
Information Expected
Information saturated (h1) model Structured
Regressions:
Estimate Std.Err z-value P(>|z|) Std.lv
Commit_Summed_T2 ~
Commit_Smmd_T1 0.807 0.038 21.145 0.000 0.807
Burnout_Summed_T2 ~
Burnot_Smmd_T1 0.770 0.041 18.835 0.000 0.770
Std.all
0.790
0.754
Covariances:
Estimate Std.Err z-value P(>|z|) Std.lv
.Commit_Summed_T2 ~~
.Burnot_Smmd_T2 -1.643 0.619 -2.656 0.008 -1.643
Std.all
-0.166
Variances:
Estimate Std.Err z-value P(>|z|) Std.lv Std.all
.Commit_Smmd_T2 6.359 0.556 11.446 0.000 6.359 0.375
.Burnot_Smmd_T2 15.346 1.341 11.446 0.000 15.346 0.431