The summary() function gives a nice overview of a fitted model, but is for
display only. If you need the actual numbers for further processing, you may
prefer to use one of several 'extractor' functions. We have already seen the
coef() function which extracts the estimated parameters of a fitted model.
Other extractor functions are discussed below.
The parameterEstimates function extracts not only the values of the estimated
parameters, but also the standard errors, the z-values, the standardized
parameter values, and returns everything conveniently as a data frame. For
The standardizedSolution() function is similar to the parameterEstimates()
function, but only shows the unstandardized and standardized parameter
The fitted() and fitted.values() functions return the
model-implied (fitted) covariance matrix (and mean vector) of a fitted model:
The resid() or residuals() functions return (unstandardized) residuals of a
fitted model. This is simply the difference between the observed and implied
covariance matrix and mean vector. If the estimator is maximum likelihood, it
is also possible to obtain the normalized and the standardized
residuals (note: you may observe several NA values, but they can be
The function vcov() returns the estimated covariance matrix of the parameter
AIC and BIC
The AIC() and BIC() functions return the AIC and BIC values of a fitted
The fitMeasures() function returns all the fit measures computed by lavaan as
a named numeric vector.
If you only want the value of a single fit measure,
say, the CFI, you give the name (in lower case) as the second argument:
Or you can provide a vector of fit measures, as in
If you want to peek inside a fitted lavaan object (the object that is returned
by a call to cfa(), sem()or growth()), you can use the inspect()
function, with a variety of options. By default, calling inspect() on a
fitted lavaan object returns a list of the model matrices that are used
internally to represent the model. The free parameters are nonzero integers.
To see the starting values of parameters in each model matrix, type
To see how lavaan internally represents a model, you can type
This is equivalent to the parTable(fit) function. The table that
is returned here is called the 'parameter table'.
For more inspect options, see the help page for the lavaan class which
you can find by typing the following: