Set up model. library(lavaan) ## This is lavaan 0.6-1.1131 ## lavaan is BETA software! Please report any bugs. HS.model <- ' visual =~ x1 + x2 + x3 textual =~ x4 + x5 + x6 speed =~ x7 + x8 + x9 ' Say I fit a model with ML. Looks ok. fit <- lavaan(HS.model, data=HolzingerSwineford1939, auto.var=TRUE, auto.fix.first=TRUE, auto.cov.lv.x=TRUE, mimic="EQS",estimator="ML") summary(fit) ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
lavaan (0.6-1.1131) converged normally after Number of observations
35 iterations 301
Estimator Model Fit Test Statistic Degrees of freedom P-value (Chi-square)
ML 85.022 24 0.000
Parameter Estimates: Information Standard Errors Latent Variables: visual =~ x1 x2 x3 textual =~ x4 x5 x6 speed =~ x7 x8 x9 Covariances: visual ~~ textual speed textual ~~ speed
Expected Standard Estimate
Std.Err
z-value
P(>|z|)
1.000 0.554 0.729
0.100 0.109
5.544 6.674
0.000 0.000
1.000 1.113 0.926
0.066 0.056
16.986 16.675
0.000 0.000
1.000 1.180 1.082
0.165 0.151
7.140 7.143
0.000 0.000
Estimate
Std.Err
z-value
P(>|z|)
0.410 0.263
0.074 0.057
5.543 4.652
0.000 0.000
0.174
0.050
3.512
0.000
1
## Variances: ## ## .x1 ## .x2 ## .x3 ## .x4 ## .x5 ## .x6 ## .x7 ## .x8 ## .x9 ## visual ## textual ## speed
Estimate 0.551 1.138 0.847 0.372 0.448 0.357 0.802 0.489 0.568 0.812 0.983 0.385
Std.Err 0.114 0.102 0.091 0.048 0.059 0.043 0.082 0.075 0.071 0.146 0.113 0.087
z-value 4.825 11.128 9.301 7.766 7.630 8.263 9.806 6.562 7.990 5.555 8.723 4.444
P(>|z|) 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000
Then, I fit a model using MLM but don’t change any other options. Meanstructure is not requested, but from the output we can see that it is added and all intercepts are fixed to 0, which results in really bad fit. fit <- lavaan(HS.model, data=HolzingerSwineford1939, auto.var=TRUE, auto.fix.first=TRUE, auto.cov.lv.x=TRUE, mimic="EQS",estimator="MLM") summary(fit) ## lavaan (0.6-1.1131) converged normally after 79 iterations ## ## Number of observations 301 ## ## Estimator ML Robust ## Model Fit Test Statistic 1400.440 1379.242 ## Degrees of freedom 33 33 ## P-value (Chi-square) 0.000 0.000 ## Scaling correction factor 1.015 ## for the Satorra-Bentler correction ## ## Parameter Estimates: ## ## Information Expected ## Standard Errors Robust.sem ## ## Latent Variables: ## Estimate Std.Err z-value P(>|z|) ## visual =~ ## x1 1.000 ## x2 1.220 0.003 403.175 0.000 ## x3 0.463 0.002 306.143 0.000 ## textual =~ ## x4 1.000 ## x5 1.402 0.005 260.270 0.000 ## x6 0.730 0.004 199.707 0.000 ## speed =~ ## x7 1.000 ## x8 1.319 0.003 510.779 0.000 ## x9 1.284 0.002 521.853 0.000 ##
2
## Covariances: ## ## visual ~~ ## textual ## speed ## textual ~~ ## speed ## ## Intercepts: ## ## .x1 ## .x2 ## .x3 ## .x4 ## .x5 ## .x6 ## .x7 ## .x8 ## .x9 ## visual ## textual ## speed ## ## Variances: ## ## .x1 ## .x2 ## .x3 ## .x4 ## .x5 ## .x6 ## .x7 ## .x8 ## .x9 ## visual ## textual ## speed
Estimate
Std.Err
z-value
P(>|z|)
15.524 20.940
0.085 0.058
183.314 359.362
0.000 0.000
13.029
0.065
201.793
0.000
Estimate 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000
Std.Err
z-value
P(>|z|)
Estimate 0.709 1.211 0.988 0.447 0.302 0.506 0.872 0.563 0.474 25.016 10.278 17.837
Std.Err 0.092 0.136 0.067 0.046 0.060 0.058 0.076 0.072 0.065 0.099 0.099 0.069
z-value 7.670 8.931 14.698 9.790 5.075 8.686 11.538 7.863 7.248 251.582 103.579 259.452
P(>|z|) 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000
Explicitly setting observed variable intercepts free with int.ov.free=TRUE. Works fine. fit <- lavaan(HS.model, data=HolzingerSwineford1939, auto.var=TRUE, auto.fix.first=TRUE, auto.cov.lv.x=TRUE, mimic="EQS",estimator="MLM", int.ov.free=TRUE) summary(fit) ## lavaan (0.6-1.1131) converged normally after ## ## Number of observations ## ## Estimator ## Model Fit Test Statistic ## Degrees of freedom ## P-value (Chi-square)
3
35 iterations 301 ML 85.022 24 0.000
Robust 81.141 24 0.000
## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
Scaling correction factor for the Satorra-Bentler correction
1.048
Parameter Estimates: Information Standard Errors Latent Variables: visual =~ x1 x2 x3 textual =~ x4 x5 x6 speed =~ x7 x8 x9 Covariances: visual ~~ textual speed textual ~~ speed Intercepts: .x1 .x2 .x3 .x4 .x5 .x6 .x7 .x8 .x9 visual textual speed Variances: .x1 .x2 .x3 .x4 .x5 .x6
Expected Robust.sem Estimate
Std.Err
z-value
P(>|z|)
1.000 0.554 0.729
0.103 0.115
5.359 6.367
0.000 0.000
1.000 1.113 0.926
0.066 0.060
16.762 15.497
0.000 0.000
1.000 1.180 1.082
0.152 0.132
7.758 8.169
0.000 0.000
Estimate
Std.Err
z-value
P(>|z|)
0.410 0.263
0.082 0.055
4.966 4.762
0.000 0.000
0.174
0.055
3.139
0.002
Estimate 4.936 6.088 2.250 3.061 4.341 2.186 4.186 5.527 5.374 0.000 0.000 0.000
Std.Err 0.067 0.068 0.065 0.067 0.075 0.063 0.063 0.058 0.058
z-value 73.229 89.556 34.464 45.542 58.258 34.552 66.544 94.539 92.238
P(>|z|) 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000
Estimate 0.551 1.138 0.847 0.372 0.448 0.357
Std.Err 0.139 0.108 0.085 0.050 0.058 0.046
z-value 3.968 10.554 9.985 7.423 7.688 7.700
P(>|z|) 0.000 0.000 0.000 0.000 0.000 0.000
4
## ## ## ## ## ##
.x7 .x8 .x9 visual textual speed
0.802 0.489 0.568 0.812 0.983 0.385
0.079 0.075 0.068 0.168 0.121 0.083
10.168 6.567 8.332 4.837 8.109 4.635
0.000 0.000 0.000 0.000 0.000 0.000
Use cfa() instead with MLM. Also no problem. fit <- cfa(HS.model, data=HolzingerSwineford1939, mimic="EQS",estimator="MLM") summary(fit) ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
lavaan (0.6-1.1131) converged normally after Number of observations
35 iterations 301
Estimator Model Fit Test Statistic Degrees of freedom P-value (Chi-square) Scaling correction factor for the Satorra-Bentler correction
ML 85.022 24 0.000
Parameter Estimates: Information Standard Errors Latent Variables: visual =~ x1 x2 x3 textual =~ x4 x5 x6 speed =~ x7 x8 x9 Covariances: visual ~~ textual speed textual ~~ speed Intercepts: .x1
Expected Robust.sem Estimate
Std.Err
z-value
P(>|z|)
1.000 0.554 0.729
0.103 0.115
5.359 6.367
0.000 0.000
1.000 1.113 0.926
0.066 0.060
16.762 15.497
0.000 0.000
1.000 1.180 1.082
0.152 0.132
7.758 8.169
0.000 0.000
Estimate
Std.Err
z-value
P(>|z|)
0.410 0.263
0.082 0.055
4.966 4.762
0.000 0.000
0.174
0.055
3.139
0.002
Estimate 4.936
Std.Err 0.067
z-value 73.229
P(>|z|) 0.000
5
Robust 81.141 24 0.000 1.048
## .x2 ## .x3 ## .x4 ## .x5 ## .x6 ## .x7 ## .x8 ## .x9 ## visual ## textual ## speed ## ## Variances: ## ## .x1 ## .x2 ## .x3 ## .x4 ## .x5 ## .x6 ## .x7 ## .x8 ## .x9 ## visual ## textual ## speed
6.088 2.250 3.061 4.341 2.186 4.186 5.527 5.374 0.000 0.000 0.000
0.068 0.065 0.067 0.075 0.063 0.063 0.058 0.058
89.556 34.464 45.542 58.258 34.552 66.544 94.539 92.238
0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000
Estimate 0.551 1.138 0.847 0.372 0.448 0.357 0.802 0.489 0.568 0.812 0.983 0.385
Std.Err 0.139 0.108 0.085 0.050 0.058 0.046 0.079 0.075 0.068 0.168 0.121 0.083
z-value 3.968 10.554 9.985 7.423 7.688 7.700 10.168 6.567 8.332 4.837 8.109 4.635
P(>|z|) 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000
6