I estimate a latent variable model in lavaan
in R
, such as
library(lavaan)
HS.model <- ' visual =~ x1 + x2 + x3
textual =~ x4 + x5 + x6
speed =~ x7 + x8 + x9 '
fit <- lavaan(HS.model, data=HolzingerSwineford1939,
auto.var=TRUE, auto.fix.first=TRUE,
auto.cov.lv.x=TRUE)
I would like to assign the model summary to an object and save
it.
fit.sum <- summary(fit, fit.measures=TRUE)
However,
> fit.sum
NULL
Furthermore it is not possible to call the fit indices (e.g. RMSEA
) from the model summary (e.g. summary(fit, fit.measures=TRUE)$RMSEA
or alike).
- Why can't I save this model summary?
- How can I save the model summary? The background is that I have a
large model and
summary()
actually needs a lot of computing time to give output. It seems some statistics are computed when callingsummary()
. - How can I extract the fit indices from
summary()
or where else can I access them infit
?