lavListInspect()
and lavListTech()
functions can be used to
inspect/extract information that is stored inside (or can be computed from) a
lavaanList object.lavListInspect(object, what = "free", add.labels = TRUE,
add.class = TRUE, list.by.group = TRUE,
drop.list.single.group = TRUE)lavListTech(object, what = "free", add.labels = FALSE,
add.class = FALSE, list.by.group = FALSE,
drop.list.single.group = FALSE)
what
argument is not case-sensitive
(everything is converted to lower case.)TRUE
, variable names are added to the vectors
and/or matrices.TRUE
, vectors are given the `lavaan.vector' class;
matrices are given the `lavaan.matrix' class, and symmetric matrices are
given the `lavaan.matrix.symmetric' class. This only affects the way they
are printed on the screen.TRUE
, the model matrices are nested within groups. If FALSE
,
a flattened list is returned containing all model matrices, with repeated
names for multiple groups.FALSE
, the results are returned as
a list, where each element corresponds to a group (even if there is only
a single group.) If TRUE
, the list will be unlisted if there is
only a single group.lavListInspect()
and lavListTech()
functions only differ in
the way they return the results. The lavListInspect()
function will
prettify the output by default, while the lavListTech()
will not attempt
to prettify the output by default. Below is a list of possible values for the what
argument, organized
in several sections: Model matrices: "free"
:coef()
and vcov()
."partable"
:parTable
."start"
:"starting.values"
."group"
:"ngroups"
:"group.label"
:"cluster"
:"ordered"
:"nobs"
:"norig"
:"ntotal"
:"nobs"
option; if there are multiple groups,
this is the sum of the "nobs"
numbers for each group
(in each dataset)."meanstructure"
:TRUE
if a meanstructure
was included in the model."categorical"
:TRUE
if categorical endogenous
variables were part of the model."fixed.x"
:TRUE
if the exogenous x-covariates
are treated as fixed."parameterization"
:"delta"
or
"theta"
."list"
:parTable()
."options"
:"call"
:lavaanList
# fit model
HS.model <- ' visual =~ x1 + x2 + x3
textual =~ x4 + x5 + x6
speed =~ x7 + x8 + x9 '
# a data generating function
generateData <- function() simulateData(HS.model, sample.nobs = 100)
set.seed(1234)
fit <- semList(HS.model, dataFunction = generateData, ndat = 5,
store.slots = "partable")
# extract information
lavListInspect(fit, "free")
lavListTech(fit, "free")
Run the code above in your browser using DataCamp Workspace