How do I compute the standardized coefficients in the lavaan
outputs?
This doesn't work for me for some reason. Not for CFA and not for SEM.
For CFA, suppose I run the following code:
data(HolzingerSwineford1939)
dat = HolzingerSwineford1939[,7:15]
model = 'visual =~ x1 + x2 + x3
textual =~ x4 + x5 + x6
speed =~ x7 + x8 + x9'
fit = cfa(model, data=dat)
summary(fit, standardized=T)
I get the following (truncated here):
Estimate Std.Err z-value P(>|z|) Std.lv Std.all visual =~ x1 1.000 0.900 0.772 x2 0.554 0.100 5.554 0.000 0.498 0.424 x3 0.729 0.109 6.685 0.000 0.656 0.581 ... Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .x1 0.549 0.114 4.833 0.000 0.549 0.404 .x2 1.134 0.102 11.146 0.000 1.134 0.821 .x3 0.844 0.091 9.317 0.000 0.844 0.662 ... visual 0.809 0.145 5.564 0.000 1.000 1.000
The Std.lv seems to be the original estimates *
sd(latent). E.g., for x2, 0.498=0.554*sqrt(0.809). (I would have thought it to be divided by, and not multiplied by, but ok).
But the Std.all doesn't seem to be this divided by the sd(variable). E.g. for x2, 0.424 != 0.554*sqrt(0.809/1.134)...
For SEM it's the same. Std.lv are equal, but std.all are not. E.g.:
model <- '
# measurement model (CFA)
ind60 =~ x1 + x2 + x3
dem60 =~ y1 + y2 + y3 + y4
dem65 =~ y5 + y6 + y7 + y8
# regressions / path analysis
dem60 ~ ind60
dem65 ~ ind60 + dem60
# residual correlations
y1 ~~ y5
y2 ~~ y4 + y6
y3 ~~ y7
y4 ~~ y8
y6 ~~ y8
'
fit = sem(model, data=PoliticalDemocracy)
summary(fit, standardized=TRUE)
Any help will be appreciated.
But the Std.all doesn't seem to be this divided by the sd(variable). E.g. for x2, 0.424 != 0.554*sqrt(0.809/1.134)
1.134 is not the marginal variance, it is the residual variance. Marginal variances are not SEM parameters, except by coincidence when a variable has not predictors.
You can use the model-implied variances on the diagonal of lavInspect(fit, "cov.ov")
and lavInspect(fit, "cov.lv")
to standardize coefficients between observed and/or latent variables, respectively.