Configural model
#plain lavaan
m0 <- "ly1 =~ pc1_1+pc2_1+pc3_1+pc4_1; ly2 =~ pc1_2+pc2_2+pc3_2+pc4_2"
f0 <- sem(m0, dat, ordered=T, std.lv=T, se="robust.sem", test="satorra.bentler", parameterization="theta")
#using semtools
syntax.config <- measEq.syntax(configural.model = f0, data=dat, parameterization="theta",
ID.fac = "std.lv", ID.cat = "Wu.Estabrook.2016",
ordered=T,
longFacNames = list(LY=c("ly1", "ly2")))
cat(as.character(syntax.config))
## ## LOADINGS:
##
## ly1 =~ NA*pc1_1 + lambda.1_1*pc1_1
## ly1 =~ NA*pc2_1 + lambda.2_1*pc2_1
## ly1 =~ NA*pc3_1 + lambda.3_1*pc3_1
## ly1 =~ NA*pc4_1 + lambda.4_1*pc4_1
## ly2 =~ NA*pc1_2 + lambda.5_2*pc1_2
## ly2 =~ NA*pc2_2 + lambda.6_2*pc2_2
## ly2 =~ NA*pc3_2 + lambda.7_2*pc3_2
## ly2 =~ NA*pc4_2 + lambda.8_2*pc4_2
##
## ## THRESHOLDS:
##
## pc1_1 | NA*t1 + pc1_1.thr1*t1
## pc1_1 | NA*t2 + pc1_1.thr2*t2
## pc1_1 | NA*t3 + pc1_1.thr3*t3
## pc2_1 | NA*t1 + pc2_1.thr1*t1
## pc2_1 | NA*t2 + pc2_1.thr2*t2
## pc2_1 | NA*t3 + pc2_1.thr3*t3
## pc3_1 | NA*t1 + pc3_1.thr1*t1
## pc3_1 | NA*t2 + pc3_1.thr2*t2
## pc3_1 | NA*t3 + pc3_1.thr3*t3
## pc4_1 | NA*t1 + pc4_1.thr1*t1
## pc4_1 | NA*t2 + pc4_1.thr2*t2
## pc4_1 | NA*t3 + pc4_1.thr3*t3
## pc1_2 | NA*t1 + pc1_2.thr1*t1
## pc1_2 | NA*t2 + pc1_2.thr2*t2
## pc1_2 | NA*t3 + pc1_2.thr3*t3
## pc2_2 | NA*t1 + pc2_2.thr1*t1
## pc2_2 | NA*t2 + pc2_2.thr2*t2
## pc2_2 | NA*t3 + pc2_2.thr3*t3
## pc3_2 | NA*t1 + pc3_2.thr1*t1
## pc3_2 | NA*t2 + pc3_2.thr2*t2
## pc3_2 | NA*t3 + pc3_2.thr3*t3
## pc4_2 | NA*t1 + pc4_2.thr1*t1
## pc4_2 | NA*t2 + pc4_2.thr2*t2
## pc4_2 | NA*t3 + pc4_2.thr3*t3
##
## ## INTERCEPTS:
##
## pc1_1 ~ 0*1 + nu.1*1
## pc2_1 ~ 0*1 + nu.2*1
## pc3_1 ~ 0*1 + nu.3*1
## pc4_1 ~ 0*1 + nu.4*1
## pc1_2 ~ 0*1 + nu.5*1
## pc2_2 ~ 0*1 + nu.6*1
## pc3_2 ~ 0*1 + nu.7*1
## pc4_2 ~ 0*1 + nu.8*1
##
## ## UNIQUE-FACTOR VARIANCES:
##
## pc1_1 ~~ 1*pc1_1 + theta.1_1*pc1_1
## pc2_1 ~~ 1*pc2_1 + theta.2_2*pc2_1
## pc3_1 ~~ 1*pc3_1 + theta.3_3*pc3_1
## pc4_1 ~~ 1*pc4_1 + theta.4_4*pc4_1
## pc1_2 ~~ 1*pc1_2 + theta.5_5*pc1_2
## pc2_2 ~~ 1*pc2_2 + theta.6_6*pc2_2
## pc3_2 ~~ 1*pc3_2 + theta.7_7*pc3_2
## pc4_2 ~~ 1*pc4_2 + theta.8_8*pc4_2
##
## ## UNIQUE-FACTOR COVARIANCES:
##
## pc1_1 ~~ NA*pc1_2 + theta.5_1*pc1_2
## pc2_1 ~~ NA*pc2_2 + theta.6_2*pc2_2
## pc3_1 ~~ NA*pc3_2 + theta.7_3*pc3_2
## pc4_1 ~~ NA*pc4_2 + theta.8_4*pc4_2
##
## ## LATENT MEANS/INTERCEPTS:
##
## ly1 ~ 0*1 + alpha.1*1
## ly2 ~ 0*1 + alpha.2*1
##
## ## COMMON-FACTOR VARIANCES:
##
## ly1 ~~ 1*ly1 + psi.1_1*ly1
## ly2 ~~ 1*ly2 + psi.2_2*ly2
##
## ## COMMON-FACTOR COVARIANCES:
##
## ly1 ~~ NA*ly2 + psi.2_1*ly2
f0 <- sem(as.character(syntax.config), dat, ordered=T, std.lv=T, se="robust.sem", test="satorra.bentler", parameterization="theta")
summary(f0)
## lavaan 0.6-7 ended normally after 35 iterations
##
## Estimator DWLS
## Optimization method NLMINB
## Number of free parameters 37
##
## Used Total
## Number of observations 185 238
##
## Model Test User Model:
## Standard Robust
## Test Statistic 28.887 77.105
## Degrees of freedom 15 15
## P-value (Chi-square) 0.017 0.000
## Scaling correction factor 0.375
## Satorra-Bentler correction
##
## Parameter Estimates:
##
## Standard errors Robust.sem
## Information Expected
## Information saturated (h1) model Unstructured
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|)
## ly1 =~
## pc1_1 (l.1_) 1.316 0.144 9.104 0.000
## pc2_1 (l.2_) 1.608 0.178 9.022 0.000
## pc3_1 (l.3_) 1.333 0.137 9.763 0.000
## pc4_1 (l.4_) 1.273 0.150 8.475 0.000
## ly2 =~
## pc1_2 (l.5_) 1.330 0.153 8.690 0.000
## pc2_2 (l.6_) 1.206 0.119 10.169 0.000
## pc3_2 (l.7_) 1.357 0.147 9.251 0.000
## pc4_2 (l.8_) 1.463 0.150 9.725 0.000
##
## Covariances:
## Estimate Std.Err z-value P(>|z|)
## .pc1_1 ~~
## .pc1_2 (t.5_) 0.012 0.080 0.146 0.884
## .pc2_1 ~~
## .pc2_2 (t.6_) 0.149 0.117 1.265 0.206
## .pc3_1 ~~
## .pc3_2 (t.7_) 0.144 0.083 1.725 0.085
## .pc4_1 ~~
## .pc4_2 (t.8_) 0.275 0.088 3.134 0.002
## ly1 ~~
## ly2 (p.2_) 0.897 0.026 35.043 0.000
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|)
## .pc1_1 (nu.1) 0.000
## .pc2_1 (nu.2) 0.000
## .pc3_1 (nu.3) 0.000
## .pc4_1 (nu.4) 0.000
## .pc1_2 (nu.5) 0.000
## .pc2_2 (nu.6) 0.000
## .pc3_2 (nu.7) 0.000
## .pc4_2 (nu.8) 0.000
## ly1 (al.1) 0.000
## ly2 (al.2) 0.000
##
## Thresholds:
## Estimate Std.Err z-value P(>|z|)
## p1_1| (p1_1.1) -1.822 0.190 -9.610 0.000
## p1_1| (p1_1.2) -0.854 0.164 -5.191 0.000
## p1_1| (p1_1.3) 0.854 0.153 5.570 0.000
## p2_1| (p2_1.1) -2.580 0.283 -9.129 0.000
## p2_1| (p2_1.2) -0.533 0.179 -2.976 0.003
## p2_1| (p2_1.3) 1.253 0.181 6.935 0.000
## p3_1| (p3_1.1) -2.161 0.214 -10.101 0.000
## p3_1| (p3_1.2) -0.306 0.156 -1.964 0.049
## p3_1| (p3_1.3) 1.606 0.177 9.049 0.000
## p4_1| (p4_1.1) -2.206 0.224 -9.847 0.000
## p4_1| (p4_1.2) -0.524 0.158 -3.320 0.001
## p4_1| (p4_1.3) 0.861 0.157 5.486 0.000
## p1_2| (p1_2.1) -2.673 0.242 -11.045 0.000
## p1_2| (p1_2.2) -1.046 0.177 -5.899 0.000
## p1_2| (p1_2.3) 1.433 0.182 7.882 0.000
## p2_2| (p2_2.1) -2.443 0.220 -11.105 0.000
## p2_2| (p2_2.2) -0.984 0.159 -6.197 0.000
## p2_2| (p2_2.3) 1.318 0.152 8.647 0.000
## p3_2| (p3_2.1) -2.709 0.261 -10.375 0.000
## p3_2| (p3_2.2) -0.950 0.174 -5.470 0.000
## p3_2| (p3_2.3) 1.554 0.176 8.814 0.000
## p4_2| (p4_2.1) -2.191 0.216 -10.134 0.000
## p4_2| (p4_2.2) -0.702 0.169 -4.162 0.000
## p4_2| (p4_2.3) 0.915 0.169 5.411 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|)
## .pc1_1 (t.1_) 1.000
## .pc2_1 (t.2_) 1.000
## .pc3_1 (t.3_) 1.000
## .pc4_1 (t.4_) 1.000
## .pc1_2 (t.5_) 1.000
## .pc2_2 (t.6_) 1.000
## .pc3_2 (t.7_) 1.000
## .pc4_2 (t.8_) 1.000
## ly1 (p.1_) 1.000
## ly2 (p.2_) 1.000
##
## Scales y*:
## Estimate Std.Err z-value P(>|z|)
## pc1_1 0.605
## pc2_1 0.528
## pc3_1 0.600
## pc4_1 0.618
## pc1_2 0.601
## pc2_2 0.638
## pc3_2 0.593
## pc4_2 0.564
Threshold constraints
syntax.thr <- measEq.syntax(configural.model = f0, data=dat, parameterization="theta",
ID.fac = "std.lv", ID.cat = "Wu.Estabrook.2016",
longFacNames = list(LY=c("ly1", "ly2")),
ordered=T,
long.equal="thresholds")
cat(as.character(syntax.thr))
## ## LOADINGS:
##
## ly1 =~ NA*pc1_1 + lambda.1_1*pc1_1
## ly1 =~ NA*pc2_1 + lambda.2_1*pc2_1
## ly1 =~ NA*pc3_1 + lambda.3_1*pc3_1
## ly1 =~ NA*pc4_1 + lambda.4_1*pc4_1
## ly2 =~ NA*pc1_2 + lambda.5_2*pc1_2
## ly2 =~ NA*pc2_2 + lambda.6_2*pc2_2
## ly2 =~ NA*pc3_2 + lambda.7_2*pc3_2
## ly2 =~ NA*pc4_2 + lambda.8_2*pc4_2
##
## ## THRESHOLDS:
##
## pc1_1 | NA*t1 + pc1_1.thr1*t1
## pc1_1 | NA*t2 + pc1_1.thr2*t2
## pc1_1 | NA*t3 + pc1_1.thr3*t3
## pc2_1 | NA*t1 + pc2_1.thr1*t1
## pc2_1 | NA*t2 + pc2_1.thr2*t2
## pc2_1 | NA*t3 + pc2_1.thr3*t3
## pc3_1 | NA*t1 + pc3_1.thr1*t1
## pc3_1 | NA*t2 + pc3_1.thr2*t2
## pc3_1 | NA*t3 + pc3_1.thr3*t3
## pc4_1 | NA*t1 + pc4_1.thr1*t1
## pc4_1 | NA*t2 + pc4_1.thr2*t2
## pc4_1 | NA*t3 + pc4_1.thr3*t3
## pc1_2 | NA*t1 + pc1_1.thr1*t1
## pc1_2 | NA*t2 + pc1_1.thr2*t2
## pc1_2 | NA*t3 + pc1_1.thr3*t3
## pc2_2 | NA*t1 + pc2_1.thr1*t1
## pc2_2 | NA*t2 + pc2_1.thr2*t2
## pc2_2 | NA*t3 + pc2_1.thr3*t3
## pc3_2 | NA*t1 + pc3_1.thr1*t1
## pc3_2 | NA*t2 + pc3_1.thr2*t2
## pc3_2 | NA*t3 + pc3_1.thr3*t3
## pc4_2 | NA*t1 + pc4_1.thr1*t1
## pc4_2 | NA*t2 + pc4_1.thr2*t2
## pc4_2 | NA*t3 + pc4_1.thr3*t3
##
## ## INTERCEPTS:
##
## pc1_1 ~ 0*1 + nu.1*1
## pc2_1 ~ 0*1 + nu.2*1
## pc3_1 ~ 0*1 + nu.3*1
## pc4_1 ~ 0*1 + nu.4*1
## pc1_2 ~ NA*1 + nu.5*1
## pc2_2 ~ NA*1 + nu.6*1
## pc3_2 ~ NA*1 + nu.7*1
## pc4_2 ~ NA*1 + nu.8*1
##
## ## UNIQUE-FACTOR VARIANCES:
##
## pc1_1 ~~ 1*pc1_1 + theta.1_1*pc1_1
## pc2_1 ~~ 1*pc2_1 + theta.2_2*pc2_1
## pc3_1 ~~ 1*pc3_1 + theta.3_3*pc3_1
## pc4_1 ~~ 1*pc4_1 + theta.4_4*pc4_1
## pc1_2 ~~ NA*pc1_2 + theta.5_5*pc1_2
## pc2_2 ~~ NA*pc2_2 + theta.6_6*pc2_2
## pc3_2 ~~ NA*pc3_2 + theta.7_7*pc3_2
## pc4_2 ~~ NA*pc4_2 + theta.8_8*pc4_2
##
## ## UNIQUE-FACTOR COVARIANCES:
##
## pc1_1 ~~ NA*pc1_2 + theta.5_1*pc1_2
## pc2_1 ~~ NA*pc2_2 + theta.6_2*pc2_2
## pc3_1 ~~ NA*pc3_2 + theta.7_3*pc3_2
## pc4_1 ~~ NA*pc4_2 + theta.8_4*pc4_2
##
## ## LATENT MEANS/INTERCEPTS:
##
## ly1 ~ 0*1 + alpha.1*1
## ly2 ~ 0*1 + alpha.2*1
##
## ## COMMON-FACTOR VARIANCES:
##
## ly1 ~~ 1*ly1 + psi.1_1*ly1
## ly2 ~~ 1*ly2 + psi.2_2*ly2
##
## ## COMMON-FACTOR COVARIANCES:
##
## ly1 ~~ NA*ly2 + psi.2_1*ly2
f1 <- sem(as.character(syntax.thr), dat, ordered=T, std.lv=T, se="robust.sem", test="satorra.bentler", parameterization="theta")
summary(f1)
## lavaan 0.6-7 ended normally after 51 iterations
##
## Estimator DWLS
## Optimization method NLMINB
## Number of free parameters 45
## Number of equality constraints 12
##
## Used Total
## Number of observations 185 238
##
## Model Test User Model:
## Standard Robust
## Test Statistic 33.576 88.425
## Degrees of freedom 19 19
## P-value (Chi-square) 0.021 0.000
## Scaling correction factor 0.380
## Satorra-Bentler correction
##
## Parameter Estimates:
##
## Standard errors Robust.sem
## Information Expected
## Information saturated (h1) model Unstructured
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|)
## ly1 =~
## pc1_1 (l.1_) 1.316 0.144 9.104 0.000
## pc2_1 (l.2_) 1.608 0.178 9.022 0.000
## pc3_1 (l.3_) 1.333 0.137 9.763 0.000
## pc4_1 (l.4_) 1.273 0.150 8.475 0.000
## ly2 =~
## pc1_2 (l.5_) 0.877 0.102 8.628 0.000
## pc2_2 (l.6_) 1.170 0.145 8.090 0.000
## pc3_2 (l.7_) 1.171 0.134 8.725 0.000
## pc4_2 (l.8_) 1.425 0.171 8.320 0.000
##
## Covariances:
## Estimate Std.Err z-value P(>|z|)
## .pc1_1 ~~
## .pc1_2 (t.5_) 0.008 0.053 0.146 0.884
## .pc2_1 ~~
## .pc2_2 (t.6_) 0.144 0.112 1.285 0.199
## .pc3_1 ~~
## .pc3_2 (t.7_) 0.124 0.071 1.753 0.080
## .pc4_1 ~~
## .pc4_2 (t.8_) 0.268 0.090 2.972 0.003
## ly1 ~~
## ly2 (p.2_) 0.897 0.026 35.043 0.000
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|)
## .pc1_1 (nu.1) 0.000
## .pc2_1 (nu.2) 0.000
## .pc3_1 (nu.3) 0.000
## .pc4_1 (nu.4) 0.000
## .pc1_2 (nu.5) -0.112 0.118 -0.951 0.342
## .pc2_2 (nu.6) 0.126 0.134 0.938 0.348
## .pc3_2 (nu.7) 0.358 0.120 2.987 0.003
## .pc4_2 (nu.8) 0.037 0.118 0.310 0.757
## ly1 (al.1) 0.000
## ly2 (al.2) 0.000
##
## Thresholds:
## Estimate Std.Err z-value P(>|z|)
## p1_1| (p1_1.1) -1.853 0.184 -10.077 0.000
## p1_1| (p1_1.2) -0.818 0.158 -5.177 0.000
## p1_1| (p1_1.3) 0.840 0.152 5.532 0.000
## p2_1| (p2_1.1) -2.395 0.266 -9.005 0.000
## p2_1| (p2_1.2) -0.705 0.167 -4.224 0.000
## p2_1| (p2_1.3) 1.342 0.182 7.369 0.000
## p3_1| (p3_1.1) -2.075 0.206 -10.059 0.000
## p3_1| (p3_1.2) -0.391 0.150 -2.614 0.009
## p3_1| (p3_1.3) 1.659 0.172 9.632 0.000
## p4_1| (p4_1.1) -2.152 0.218 -9.853 0.000
## p4_1| (p4_1.2) -0.581 0.150 -3.881 0.000
## p4_1| (p4_1.3) 0.893 0.155 5.775 0.000
## p1_2| (p1_1.1) -1.853 0.184 -10.077 0.000
## p1_2| (p1_1.2) -0.818 0.158 -5.177 0.000
## p1_2| (p1_1.3) 0.840 0.152 5.532 0.000
## p2_2| (p2_1.1) -2.395 0.266 -9.005 0.000
## p2_2| (p2_1.2) -0.705 0.167 -4.224 0.000
## p2_2| (p2_1.3) 1.342 0.182 7.369 0.000
## p3_2| (p3_1.1) -2.075 0.206 -10.059 0.000
## p3_2| (p3_1.2) -0.391 0.150 -2.614 0.009
## p3_2| (p3_1.3) 1.659 0.172 9.632 0.000
## p4_2| (p4_1.1) -2.152 0.218 -9.853 0.000
## p4_2| (p4_1.2) -0.581 0.150 -3.881 0.000
## p4_2| (p4_1.3) 0.893 0.155 5.775 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|)
## .pc1_1 (t.1_) 1.000
## .pc2_1 (t.2_) 1.000
## .pc3_1 (t.3_) 1.000
## .pc4_1 (t.4_) 1.000
## .pc1_2 (t.5_) 0.435 0.085 5.131 0.000
## .pc2_2 (t.6_) 0.942 0.179 5.266 0.000
## .pc3_2 (t.7_) 0.745 0.146 5.116 0.000
## .pc4_2 (t.8_) 0.949 0.174 5.471 0.000
## ly1 (p.1_) 1.000
## ly2 (p.2_) 1.000
##
## Scales y*:
## Estimate Std.Err z-value P(>|z|)
## pc1_1 0.605
## pc2_1 0.528
## pc3_1 0.600
## pc4_1 0.618
## pc1_2 0.911
## pc2_2 0.658
## pc3_2 0.687
## pc4_2 0.579
Model fit thresholds ok
semTools::compareFit(f0,f1)
## ################### Nested Model Comparison #########################
## 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)
## f0 15 28.887
## f1 19 33.576 11.761 4 0.01922 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## ####################### Model Fit Indices ###########################
## chisq.scaled df.scaled pvalue.scaled cfi.robust tli.robust rmsea.robust
## f0 77.105† 15 .000 0.995† .991 .092
## f1 88.425 19 .000 .995 .992† .087†
## srmr
## f0 .041†
## f1 .041
##
## ################## Differences in Fit Indices #######################
## df.scaled cfi.robust tli.robust rmsea.robust srmr
## f1 - f0 4 -0.001 0.001 -0.005 0
Loadings constrained
syntax.load <- measEq.syntax(configural.model = f0, data=dat, parameterization="theta",
ID.fac = "std.lv", ID.cat = "Wu.Estabrook.2016",
longFacNames = list(LY=c("ly1", "ly2")),
ordered=T,
long.equal=c("thresholds", "loadings"))
cat(as.character(syntax.load))
## ## LOADINGS:
##
## ly1 =~ NA*pc1_1 + lambda.1_1*pc1_1
## ly1 =~ NA*pc2_1 + lambda.2_1*pc2_1
## ly1 =~ NA*pc3_1 + lambda.3_1*pc3_1
## ly1 =~ NA*pc4_1 + lambda.4_1*pc4_1
## ly2 =~ NA*pc1_2 + lambda.1_1*pc1_2
## ly2 =~ NA*pc2_2 + lambda.2_1*pc2_2
## ly2 =~ NA*pc3_2 + lambda.3_1*pc3_2
## ly2 =~ NA*pc4_2 + lambda.4_1*pc4_2
##
## ## THRESHOLDS:
##
## pc1_1 | NA*t1 + pc1_1.thr1*t1
## pc1_1 | NA*t2 + pc1_1.thr2*t2
## pc1_1 | NA*t3 + pc1_1.thr3*t3
## pc2_1 | NA*t1 + pc2_1.thr1*t1
## pc2_1 | NA*t2 + pc2_1.thr2*t2
## pc2_1 | NA*t3 + pc2_1.thr3*t3
## pc3_1 | NA*t1 + pc3_1.thr1*t1
## pc3_1 | NA*t2 + pc3_1.thr2*t2
## pc3_1 | NA*t3 + pc3_1.thr3*t3
## pc4_1 | NA*t1 + pc4_1.thr1*t1
## pc4_1 | NA*t2 + pc4_1.thr2*t2
## pc4_1 | NA*t3 + pc4_1.thr3*t3
## pc1_2 | NA*t1 + pc1_1.thr1*t1
## pc1_2 | NA*t2 + pc1_1.thr2*t2
## pc1_2 | NA*t3 + pc1_1.thr3*t3
## pc2_2 | NA*t1 + pc2_1.thr1*t1
## pc2_2 | NA*t2 + pc2_1.thr2*t2
## pc2_2 | NA*t3 + pc2_1.thr3*t3
## pc3_2 | NA*t1 + pc3_1.thr1*t1
## pc3_2 | NA*t2 + pc3_1.thr2*t2
## pc3_2 | NA*t3 + pc3_1.thr3*t3
## pc4_2 | NA*t1 + pc4_1.thr1*t1
## pc4_2 | NA*t2 + pc4_1.thr2*t2
## pc4_2 | NA*t3 + pc4_1.thr3*t3
##
## ## INTERCEPTS:
##
## pc1_1 ~ 0*1 + nu.1*1
## pc2_1 ~ 0*1 + nu.2*1
## pc3_1 ~ 0*1 + nu.3*1
## pc4_1 ~ 0*1 + nu.4*1
## pc1_2 ~ NA*1 + nu.5*1
## pc2_2 ~ NA*1 + nu.6*1
## pc3_2 ~ NA*1 + nu.7*1
## pc4_2 ~ NA*1 + nu.8*1
##
## ## UNIQUE-FACTOR VARIANCES:
##
## pc1_1 ~~ 1*pc1_1 + theta.1_1*pc1_1
## pc2_1 ~~ 1*pc2_1 + theta.2_2*pc2_1
## pc3_1 ~~ 1*pc3_1 + theta.3_3*pc3_1
## pc4_1 ~~ 1*pc4_1 + theta.4_4*pc4_1
## pc1_2 ~~ NA*pc1_2 + theta.5_5*pc1_2
## pc2_2 ~~ NA*pc2_2 + theta.6_6*pc2_2
## pc3_2 ~~ NA*pc3_2 + theta.7_7*pc3_2
## pc4_2 ~~ NA*pc4_2 + theta.8_8*pc4_2
##
## ## UNIQUE-FACTOR COVARIANCES:
##
## pc1_1 ~~ NA*pc1_2 + theta.5_1*pc1_2
## pc2_1 ~~ NA*pc2_2 + theta.6_2*pc2_2
## pc3_1 ~~ NA*pc3_2 + theta.7_3*pc3_2
## pc4_1 ~~ NA*pc4_2 + theta.8_4*pc4_2
##
## ## LATENT MEANS/INTERCEPTS:
##
## ly1 ~ 0*1 + alpha.1*1
## ly2 ~ 0*1 + alpha.2*1
##
## ## COMMON-FACTOR VARIANCES:
##
## ly1 ~~ 1*ly1 + psi.1_1*ly1
## ly2 ~~ NA*ly2 + psi.2_2*ly2
##
## ## COMMON-FACTOR COVARIANCES:
##
## ly1 ~~ NA*ly2 + psi.2_1*ly2
f2 <- sem(as.character(syntax.load), dat, ordered=T, std.lv=T, se="robust.sem", test="satorra.bentler", parameterization="theta")
summary(f2)
## lavaan 0.6-7 ended normally after 44 iterations
##
## Estimator DWLS
## Optimization method NLMINB
## Number of free parameters 46
## Number of equality constraints 16
##
## Used Total
## Number of observations 185 238
##
## Model Test User Model:
## Standard Robust
## Test Statistic 43.429 104.889
## Degrees of freedom 22 22
## P-value (Chi-square) 0.004 0.000
## Scaling correction factor 0.414
## Satorra-Bentler correction
##
## Parameter Estimates:
##
## Standard errors Robust.sem
## Information Expected
## Information saturated (h1) model Unstructured
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|)
## ly1 =~
## pc1_1 (l.1_) 1.265 0.128 9.848 0.000
## pc2_1 (l.2_) 1.565 0.164 9.539 0.000
## pc3_1 (l.3_) 1.354 0.135 10.002 0.000
## pc4_1 (l.4_) 1.350 0.158 8.566 0.000
## ly2 =~
## pc1_2 (l.1_) 1.265 0.128 9.848 0.000
## pc2_2 (l.2_) 1.565 0.164 9.539 0.000
## pc3_2 (l.3_) 1.354 0.135 10.002 0.000
## pc4_2 (l.4_) 1.350 0.158 8.566 0.000
##
## Covariances:
## Estimate Std.Err z-value P(>|z|)
## .pc1_1 ~~
## .pc1_2 (t.5_) 0.012 0.060 0.204 0.838
## .pc2_1 ~~
## .pc2_2 (t.6_) 0.151 0.120 1.266 0.206
## .pc3_1 ~~
## .pc3_2 (t.7_) 0.117 0.068 1.724 0.085
## .pc4_1 ~~
## .pc4_2 (t.8_) 0.212 0.076 2.794 0.005
## ly1 ~~
## ly2 (p.2_) 0.735 0.051 14.402 0.000
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|)
## .pc1_1 (nu.1) 0.000
## .pc2_1 (nu.2) 0.000
## .pc3_1 (nu.3) 0.000
## .pc4_1 (nu.4) 0.000
## .pc1_2 (nu.5) -0.051 0.120 -0.422 0.673
## .pc2_2 (nu.6) 0.167 0.135 1.233 0.218
## .pc3_2 (nu.7) 0.337 0.119 2.835 0.005
## .pc4_2 (nu.8) -0.062 0.109 -0.567 0.571
## ly1 (al.1) 0.000
## ly2 (al.2) 0.000
##
## Thresholds:
## Estimate Std.Err z-value P(>|z|)
## p1_1| (p1_1.1) -1.937 0.182 -10.628 0.000
## p1_1| (p1_1.2) -0.847 0.157 -5.410 0.000
## p1_1| (p1_1.3) 0.958 0.152 6.302 0.000
## p2_1| (p2_1.1) -2.469 0.268 -9.207 0.000
## p2_1| (p2_1.2) -0.707 0.165 -4.284 0.000
## p2_1| (p2_1.3) 1.403 0.180 7.802 0.000
## p3_1| (p3_1.1) -2.032 0.209 -9.717 0.000
## p3_1| (p3_1.2) -0.386 0.150 -2.571 0.010
## p3_1| (p3_1.3) 1.615 0.171 9.463 0.000
## p4_1| (p4_1.1) -1.945 0.230 -8.452 0.000
## p4_1| (p4_1.2) -0.578 0.153 -3.775 0.000
## p4_1| (p4_1.3) 0.741 0.159 4.672 0.000
## p1_2| (p1_1.1) -1.937 0.182 -10.628 0.000
## p1_2| (p1_1.2) -0.847 0.157 -5.410 0.000
## p1_2| (p1_1.3) 0.958 0.152 6.302 0.000
## p2_2| (p2_1.1) -2.469 0.268 -9.207 0.000
## p2_2| (p2_1.2) -0.707 0.165 -4.284 0.000
## p2_2| (p2_1.3) 1.403 0.180 7.802 0.000
## p3_2| (p3_1.1) -2.032 0.209 -9.717 0.000
## p3_2| (p3_1.2) -0.386 0.150 -2.571 0.010
## p3_2| (p3_1.3) 1.615 0.171 9.463 0.000
## p4_2| (p4_1.1) -1.945 0.230 -8.452 0.000
## p4_2| (p4_1.2) -0.578 0.153 -3.775 0.000
## p4_2| (p4_1.3) 0.741 0.159 4.672 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|)
## .pc1_1 (t.1_) 1.000
## .pc2_1 (t.2_) 1.000
## .pc3_1 (t.3_) 1.000
## .pc4_1 (t.4_) 1.000
## .pc1_2 (t.5_) 0.568 0.124 4.593 0.000
## .pc2_2 (t.6_) 1.082 0.213 5.088 0.000
## .pc3_2 (t.7_) 0.683 0.140 4.875 0.000
## .pc4_2 (t.8_) 0.630 0.136 4.645 0.000
## ly1 (p.1_) 1.000
## ly2 (p.2_) 0.671 0.084 8.000 0.000
##
## Scales y*:
## Estimate Std.Err z-value P(>|z|)
## pc1_1 0.620
## pc2_1 0.539
## pc3_1 0.594
## pc4_1 0.595
## pc1_2 0.780
## pc2_2 0.606
## pc3_2 0.723
## pc4_2 0.735
All model fit comparisons
compareFit(f0,f1, f2)
## ################### Nested Model Comparison #########################
## 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)
## f0 15 28.887
## f1 19 33.576 11.761 4 0.019222 *
## f2 22 43.429 15.602 3 0.001368 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## ####################### Model Fit Indices ###########################
## chisq.scaled df.scaled pvalue.scaled cfi.robust tli.robust rmsea.robust
## f0 77.105† 15 .000 0.995† .991 .092
## f1 88.425 19 .000 .995 .992† .087†
## f2 104.889 22 .000 .993 .991 .092
## srmr
## f0 .041†
## f1 .041
## f2 .041
##
## ################## Differences in Fit Indices #######################
## df.scaled cfi.robust tli.robust rmsea.robust srmr
## f1 - f0 4 -0.001 0.001 -0.005 0.000
## f2 - f1 3 -0.002 -0.001 0.005 0.001