> CFAmodel <- '
+
+ Staffing =~ Q4_1_1 + Q4_2_1 + Q4_3_1 + Q4_4_1 + Q4_5_1
+ Training =~ Q5_1_1 + Q5_3_1 + Q5_4_1 + Q5_5_1
+ Compensation =~ Q6_1_1 + Q6_2_1 + Q6_3_1 + Q6_4_1
+ Rewards =~ Q7_1_1 + Q7_2_1 + Q7_3_1 + Q7_4_1 + Q7_5_1
+ Partici =~ Q9_1_1 + Q9_2_1 + Q9_3_1 + Q9_4_1
+ Empower =~ Q10_1_1 + Q10_2_1 + Q10_5_1
+ UWES =~ Q13_1_1 + Q13_2_1 + Q13_3_1 + Q13_4_1 + Q13_5_1 + Q13_6_1 + Q13_7_1 + Q13_8_1 + Q13_9_1
+ ServiceClimate =~ Q2_1_1 + Q2_3_1 + Q2_4_1 + Q2_5_1 + Q2_6_1 + Q2_7_1
+ '
> fit <- cfa(CFAmodel, data=my_data, estimator="WLSMV", ordered = c("Q4_1_1", "Q4_2_1", "Q4_3_1", "Q4_4_1", "Q4_5_1",
+ "Q5_1_1", "Q5_3_1", "Q5_4_1", "Q5_5_1",
+ "Q6_1_1", "Q6_2_1", "Q6_3_1", "Q6_4_1",
+ "Q7_1_1", "Q7_2_1", "Q7_3_1", "Q7_4_1", "Q7_5_1",
+ "Q9_1_1", "Q9_2_1", "Q9_3_1", "Q9_4_1",
+ "Q10_1_1", "Q10_2_1", "Q10_5_1",
+ "Q13_1_1", "Q13_2_1", "Q13_3_1", "Q13_4_1", "Q13_5_1", "Q13_6_1", "Q13_7_1", "Q13_8_1", "Q13_9_1",
+ "Q2_1_1", "Q2_3_1", "Q2_4_1", "Q2_5_1", "Q2_6_1", "Q2_7_1"), mimic="Mplus")Warning message:
In lav_model_vcov(lavmodel = lavmodel2, lavsamplestats = lavsamplestats, :
lavaan WARNING:
The variance-covariance matrix of the estimated parameters (vcov)
does not appear to be positive definite! The smallest eigenvalue
(= -2.167349e-17) is smaller than zero. This may be a symptom that
the model is not identified.
Despite this, the model produces what seems like a sensible solution:
lavaan 0.6-5 ended normally after 79 iterations
Estimator DWLS
Optimization method NLMINB
Number of free parameters 244
Number of observations 781
Model Test User Model:
Standard Robust
Test Statistic 974.79105 1322.25029
Degrees of freedom 712 712
P-value (Chi-square) 0.00000 0.00000
Scaling correction factor 1.02761
Shift parameter 373.64875
for the simple second-order correction (WLSMV)
Model Test Baseline Model:
Test statistic 208943.71190 40071.56631
Degrees of freedom 780 780
P-value 0.00000 0.00000
Scaling correction factor 5.29795
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.99874 0.98447
Tucker-Lewis Index (TLI) 0.99862 0.98299
Robust Comparative Fit Index (CFI) NA
Robust Tucker-Lewis Index (TLI) NA
Root Mean Square Error of Approximation:
RMSEA 0.02175 0.03315
90 Percent confidence interval - lower 0.01825 0.03036
90 Percent confidence interval - upper 0.02506 0.03592
P-value RMSEA <= 0.05 1.00000 1.00000
Robust RMSEA NA
90 Percent confidence interval - lower NA
90 Percent confidence interval - upper NA
Standardized Root Mean Square Residual:
SRMR 0.03634 0.03634
Weighted Root Mean Square Residual:
WRMR 1.00978 1.00978
However, when I now try to use the HTMT and reliability functions in semTools (0.5-2), I receive the warning / error messages shown below. No output is generated for the reliability function.
> dat <- my_data[,6:70]
> htmt(CFAmodel, dat)
Stffng Tranng Cmpnst Rewrds Partic Empowr UWES SrvcCl
Staffing 1.000
Training 0.618 1.000
Compensation 0.520 0.458 1.000
Rewards 0.739 0.631 0.593 1.000
Partici 0.673 0.681 0.459 0.766 1.000
Empower 0.654 0.593 0.458 0.656 0.699 1.000
UWES 0.355 0.365 0.254 0.367 0.347 0.318 1.000
ServiceClimate 0.610 0.641 0.451 0.647 0.692 0.536 0.371 1.000
Warning message:
In lavaan(slotParTable = PT.un, slotData = lav.data, model.type = "unrestricted", :
lavaan WARNING: estimation of the baseline model failed.
> reliability(fit)
Error: $ operator not defined for this S4 class
Could you please assist me by indicating what these warning / error messages mean and how the problem can be resolved.
Kind regards,
Theuns