0

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).

  1. Why can't I save this model summary?
  2. 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 calling summary().
  3. How can I extract the fit indices from summary() or where else can I access them in fit?
tomka
  • 2,516
  • 7
  • 31
  • 45
  • 1
    Because the summary method doesn't return anything, it just prints information. If you read about the `lavaan` class object you'll see a list of lots of methods for extract specific pieces of information about the model. – joran Mar 02 '16 at 19:13
  • Okay -- I also see now one may use `inspect(fit, "fitMeasures")` with `$rmsea` to extract the fit measures – tomka Mar 02 '16 at 19:20

0 Answers0