A set of parameters is not identified when multiple set of values leads to the same estimation criterion
E.g., \(5 = a + b\): \(a = 2, b = 3\); \(a = 10, b = -5\), etc
In CFA, as we are fitting the covariance matrix, we can have at most \(p \times (p + 1) / 2\) parameters, which will perfectly reproduce the variances and covariances
cfa_fit <-cfa(cfa_mod,sample.cov = covy,# number of observationssample.nobs =1022,# estimatorestimator ="ML",# default option to correlate latent factorsauto.cov.lv.x =TRUE,# Model identified by fixing the loading of first indicator to 1std.lv =FALSE)
psych::mardia(bfi[1:25]) # see the "kurtosis" value = 71.53
Call: psych::mardia(x = bfi[1:25])
Mardia tests of multivariate skew and kurtosis
Use describe(x) the to get univariate tests
n.obs = 2436 num.vars = 25
b1p = 27.66 skew = 11229.18 with probability <= 0
small sample skew = 11244.07 with probability <= 0
b2p = 781.5 kurtosis = 71.53 with probability <= 0
Continuous: normal-distribution-based MLM
Adjust the test statistic for nonnormality in data
Sandwich estimator for standard errors
MLR: accounts for missing data
Categorical: WLSMV
Diagonal matrix as weight matrix for estimates
Full weight matrix for standard errors and adjusted test statistic
lavaan 0.6.15 ended normally after 25 iterations
Estimator DWLS
Optimization method NLMINB
Number of model parameters 61
Used Total
Number of observations 2632 2800
Model Test User Model:
Standard Scaled
Test Statistic 449.278 593.496
Degrees of freedom 34 34
P-value (Chi-square) 0.000 0.000
Scaling correction factor 0.764
Shift parameter 5.648
simple second-order correction
Alternative Fit Indices
How good is the fit, if not perfect?
RMSEA, CFI: based on \(\chi^2\)
SRMR: overall discrepancy between model-implied and sample covariance matrix
Danger
Good model fit does not mean that the model is useful. Pay attention to the parameter values
summary(cfa_fit, fit.measures =TRUE)
lavaan 0.6.15 ended normally after 46 iterations
Estimator ML
Optimization method NLMINB
Number of model parameters 30
Number of observations 1022
Model Test User Model:
Test statistic 284.046
Degrees of freedom 48
P-value (Chi-square) 0.000
Model Test Baseline Model:
Test statistic 4417.935
Degrees of freedom 66
P-value 0.000
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.946
Tucker-Lewis Index (TLI) 0.925
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -20021.587
Loglikelihood unrestricted model (H1) -19879.564
Akaike (AIC) 40103.175
Bayesian (BIC) 40251.060
Sample-size adjusted Bayesian (SABIC) 40155.777
Root Mean Square Error of Approximation:
RMSEA 0.069
90 Percent confidence interval - lower 0.062
90 Percent confidence interval - upper 0.077
P-value H_0: RMSEA <= 0.050 0.000
P-value H_0: RMSEA >= 0.080 0.013
Standardized Root Mean Square Residual:
SRMR 0.050
Parameter Estimates:
Standard errors Standard
Information Expected
Information saturated (h1) model Structured
Latent Variables:
Estimate Std.Err z-value P(>|z|)
PerfAppr =~
I1 1.000
I2 1.034 0.036 29.060 0.000
I3 1.053 0.036 29.039 0.000
PerfAvoi =~
I4 1.000
I5 0.772 0.061 12.678 0.000
I6 1.197 0.081 14.828 0.000
MastAvoi =~
I7 1.000
I8 1.955 0.149 13.138 0.000
I9 1.856 0.140 13.303 0.000
MastAppr =~
I10 1.000
I11 0.974 0.052 18.567 0.000
I12 1.043 0.057 18.196 0.000
Covariances:
Estimate Std.Err z-value P(>|z|)
PerfAppr ~~
PerfAvoi 0.752 0.074 10.167 0.000
MastAvoi 0.196 0.034 5.762 0.000
MastAppr 0.309 0.042 7.396 0.000
PerfAvoi ~~
MastAvoi 0.377 0.046 8.275 0.000
MastAppr 0.080 0.039 2.064 0.039
MastAvoi ~~
MastAppr 0.159 0.025 6.457 0.000
Variances:
Estimate Std.Err z-value P(>|z|)
.I1 0.820 0.050 16.300 0.000
.I2 0.649 0.046 13.968 0.000
.I3 0.679 0.048 14.026 0.000
.I4 2.450 0.133 18.465 0.000
.I5 2.039 0.103 19.751 0.000
.I6 1.077 0.109 9.890 0.000
.I7 1.585 0.075 21.188 0.000
.I8 0.607 0.080 7.637 0.000
.I9 1.111 0.084 13.208 0.000
.I10 0.726 0.043 16.785 0.000
.I11 0.329 0.030 10.846 0.000
.I12 0.716 0.045 16.088 0.000
PerfAppr 1.581 0.106 14.955 0.000
PerfAvoi 1.311 0.148 8.881 0.000
MastAvoi 0.429 0.061 7.055 0.000
MastAppr 0.664 0.060 11.084 0.000
For MLR, WLSMV, etc, use the “robust” versions of CFI, RMSEA
Correlation Residuals
# Extra correlation between I7 and I5resid(cfa_fit, type ="cor")
Compute \(\omega\) for the PerfAvoi factor, using results from the previous slide.
semTools::compRelSEM( cfa_fit)
Difference test
Requires nested models
Get M0 by placing constraints on M1
Difference of two \(\chi^2\) test statistic is also a \(\chi^2\), with df = difference in the dfs of the two models
Need adjustment for MLR, WLSMV, etc
If constraining parameter on the boundary, need adjusting critical values
E.g., compare 1- vs. 2-factor by setting factor cor to 1
Example: Parallel Test
# Treat items as continuous for illustrative purposesag_congeneric <-" Ag =~ A1 + A2 + A3 + A4 + A5 # Intercepts (default) A1 + A2 + A3 + A4 + A5 ~ NA * 1 # Fixed factor mean Ag ~ 0 # Free variances (default) A1 ~~ NA * A1 A2 ~~ NA * A2 A3 ~~ NA * A3 A4 ~~ NA * A4 A5 ~~ NA * A5"con_fit <-cfa(ag_congeneric, data = bfi, estimator ="MLR",meanstructure =TRUE)
ag_parallel <-" # Loadings = 1 Ag =~ 1 * A1 + 1 * A2 + 1 * A3 + 1 * A4 + 1 * A5 # Intercepts = 0 A1 + A2 + A3 + A4 + A5 ~ 0 # Free factor mean Ag ~ NA * 1 # Equal variances (use same labels) A1 ~~ v * A1 A2 ~~ v * A2 A3 ~~ v * A3 A4 ~~ v * A4 A5 ~~ v * A5"par_fit <-cfa(ag_parallel, data = bfi, estimator ="MLR",meanstructure =TRUE)
# Likelihood-ratio test (chi-squared difference test)lavTestLRT(par_fit, con_fit)
Scaled Chi-Squared Difference Test (method = "satorra.bentler.2001")
lavaan NOTE:
The "Chisq" column contains standard test statistics, not the
robust test that should be reported per model. A robust difference
test is a function of two standard (not robust) statistics.
Df AIC BIC Chisq Chisq diff Df diff Pr(>Chisq)
con_fit 5 43585 43674 86.696
par_fit 17 51304 51322 7829.963 5837.2 12 < 2.2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1