I want all factor loadings to be free estimated. How can I do this? The following syntax doesn't work
In another case I want to fix parameters. But this synatx doesn't work either:
myModel32 <- 'Video 1 =~ NA*V1_OD1a + V1_OR1a
Video 2 =~ NA*V2_OD1a + V2_OR1a
Text 1=~ NA*T1_OD1a + T1_OR1a
Text 2=~ NA*T2_OD1a + T2_OR1a
Diagnostik =~ T1_OD1a + 1*V1_OD1a + 1*T2_OD1a + 1*V2_OD1a
Rückmeldung =~ T1_OR1a + 1*V1_OR1a + 1*T2_OR1a + 1*V2_OR1a
'
fit32 <- cfa(myModel32)
parTable(fit32)
sessionInfo()
> myModel11 <- "FA =~ NA*T1_OD1a + T1_OR1a + V1_OD1a + V1_OR1a + T2_OD1a + T2_OR1a + V2_OD1a + V2_OR1a"
> fit11 <- cfa(myModel11, data=data.T1, estimator = "WLSMV", ordered = c("T1_OD1a, T1_OR1a, V1_OD1a, V1_OR1a, T2_OD1a, T2_OR1a, V2_OD1a, V2_OR1a"))
Warning messages:
1: In lav_partable_check(lavpartable, categorical = lavoptions$categorical, :
lavaan WARNING: parameter table does not contain thresholds
2: In lav_model_vcov(lavmodel = lavmodel, lavsamplestats = lavsamplestats, :
lavaan WARNING:
Could not compute standard errors! The information matrix could
not be inverted. This may be a symptom that the model is not
identified.
3: In lav_test_satorra_bentler(lavobject = NULL, lavsamplestats = lavsamplestats, :
lavaan WARNING: could not invert information matrix
> model <- summary(fit11, fit.measures = TRUE, rsq=TRUE, standardized=TRUE)
lavaan 0.6-3 ended normally after 32 iterations
Optimization method NLMINB
Number of free parameters 25
Used Total
Number of observations 276 277
Estimator DWLS
Model Fit Test Statistic 18.481
Degrees of freedom 19
P-value (Chi-square) 0.491
Error in TEST[[2]] : subscript out of bounds
> myModel11 <- "FA =~ T1_OD1a + T1_OR1a + V1_OD1a + V1_OR1a + T2_OD1a + T2_OR1a + V2_OD1a + V2_OR1a"
> fit11 <- cfa(myModel11, data=data.T1, estimator = "WLSMV", ordered = c("T1_OD1a, T1_OR1a, V1_OD1a, V1_OR1a, T2_OD1a, T2_OR1a, V2_OD1a, V2_OR1a"))
Warning messages:
1: In lav_partable_check(lavpartable, categorical = lavoptions$categorical, :
lavaan WARNING: parameter table does not contain thresholds
2: In lav_model_vcov(lavmodel = lavmodel, lavsamplestats = lavsamplestats, :
lavaan WARNING:
The variance-covariance matrix of the estimated parameters (vcov)
does not appear to be positive definite! The smallest eigenvalue
(= -5.703747e-18) is smaller than zero. This may be a symptom that
the model is not identified.
> model <- summary(fit11, fit.measures = TRUE, rsq=TRUE, standardized=TRUE)
lavaan 0.6-3 ended normally after 37 iterations
Optimization method NLMINB
Number of free parameters 24
Used Total
Number of observations 276 277
Estimator DWLS Robust
Model Fit Test Statistic 18.481 35.161
Degrees of freedom 20 20
P-value (Chi-square) 0.556 0.019
Scaling correction factor 0.568
Shift parameter 2.640
for simple second-order correction (Mplus variant)
Model test baseline model:
Minimum Function Test Statistic 257.648 136.904
Degrees of freedom 28 28
P-value 0.000 0.000
User model versus baseline model:
Comparative Fit Index (CFI) 1.000 0.861
Tucker-Lewis Index (TLI) 1.009 0.805
Robust Comparative Fit Index (CFI) NA
Robust Tucker-Lewis Index (TLI) NA
Root Mean Square Error of Approximation:
RMSEA 0.000 0.053
90 Percent Confidence Interval 0.000 0.048 0.021 0.081
P-value RMSEA <= 0.05 0.961 0.409
Robust RMSEA NA
90 Percent Confidence Interval NA NA
Standardized Root Mean Square Residual:
SRMR 0.055 0.055
Parameter Estimates:
Information Expected
Information saturated (h1) model Unstructured
Standard Errors Robust.sem
Latent Variables:
Estimate Std.Err z-value P(>|z|) Std.lv Std.all
FA =~
T1_OD1a 1.000 0.177 0.463
T1_OR1a 0.609 0.168 3.631 0.000 0.108 0.284
V1_OD1a 1.173 0.218 5.393 0.000 0.208 0.463
V1_OR1a 0.783 0.175 4.474 0.000 0.139 0.421
T2_OD1a 1.479 0.264 5.612 0.000 0.262 0.660
T2_OR1a 0.524 0.153 3.428 0.001 0.093 0.366
V2_OD1a 1.536 0.290 5.289 0.000 0.272 0.583
V2_OR1a 0.628 0.178 3.533 0.000 0.111 0.410
Intercepts:
Estimate Std.Err z-value P(>|z|) Std.lv Std.all
.T1_OD1a 1.178 0.023 51.102 0.000 1.178 3.076
.T1_OR1a 1.174 0.023 51.360 0.000 1.174 3.091
.V1_OD1a 1.279 0.027 47.290 0.000 1.279 2.847
.V1_OR1a 1.123 0.020 56.674 0.000 1.123 3.411
.T2_OD1a 1.196 0.024 49.981 0.000 1.196 3.009
.T2_OR1a 1.069 0.015 70.008 0.000 1.069 4.214
.V2_OD1a 1.319 0.028 46.930 0.000 1.319 2.825
.V2_OR1a 1.080 0.016 66.108 0.000 1.080 3.979
FA 0.000 0.000 0.000
Variances:
Estimate Std.Err z-value P(>|z|) Std.lv Std.all
.T1_OD1a 0.115 0.014 8.284 0.000 0.115 0.786
.T1_OR1a 0.133 0.015 9.007 0.000 0.133 0.919
.V1_OD1a 0.159 0.015 10.791 0.000 0.159 0.786
.V1_OR1a 0.089 0.013 6.742 0.000 0.089 0.823
.T2_OD1a 0.089 0.013 7.114 0.000 0.089 0.565
.T2_OR1a 0.056 0.011 5.086 0.000 0.056 0.866
.V2_OD1a 0.144 0.015 9.510 0.000 0.144 0.660
.V2_OR1a 0.061 0.011 5.468 0.000 0.061 0.832
FA 0.031 0.011 2.977 0.003 1.000 1.000
R-Square:
Estimate
T1_OD1a 0.214
T1_OR1a 0.081
V1_OD1a 0.214
V1_OR1a 0.177
T2_OD1a 0.435
T2_OR1a 0.134
V2_OD1a 0.340
V2_OR1a 0.168
Results using "NA*"> myModel11 <- "FA =~ NA*T1_OD1a + T1_OR1a + V1_OD1a + V1_OR1a + T2_OD1a + T2_OR1a + V2_OD1a + V2_OR1a" > fit11 <- cfa(myModel11, data=data.T1, estimator = "WLSMV", ordered = c("T1_OD1a, T1_OR1a, V1_OD1a, V1_OR1a, T2_OD1a, T2_OR1a, V2_OD1a, V2_OR1a"))