Learn R Programming

lavaan (version 0.5-17)

lavInspect: Inspect or extract information from a fitted lavaan object

Description

The lavInspect() and lavTech() functions can be used to inspect/extract information that is stored inside (or can be computed from) a fitted lavaan object. Note: the (older) S4 inspect() method is now a shortcut for lavInspect() with default arguments.

Usage

lavInspect(lavobject, what = "free", add.labels = TRUE, add.class = TRUE, 
           drop.list.single.group = TRUE)

lavTech(lavobject, what = "free", add.labels = FALSE, add.class = FALSE, drop.list.single.group = FALSE)

Arguments

lavobject
An object of class lavaan.
what
Character. What needs to be inspected/extracted? See Details for a full list. Note: the what argument is not case-sensitive (everything is converted to lower case.)
add.labels
If TRUE, variable names are added to the vectors and/or matrices.
add.class
If 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.
drop.list.single.group
If 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.

Details

The lavInspect() and lavTech() functions only differ in the way they return the results. The lavInspect() function will prettify the output by default, while the lavTech() will not attempt to prettify the output by default. The (older) inspect() function is a simplified version of lavInspect() with only the first two arguments.

Below is a list of possible values for the what argument, organized in several sections:

Model matrices:

[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

Observed sample statistics and information about the data:

[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

Model-implied sample statistics and fit information:

[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

Miscellaneous:

[object Object],[object Object],[object Object]

See Also

lavaan

Examples

Run this code
# fit model
HS.model <- ' visual  =~ x1 + x2 + x3
              textual =~ x4 + x5 + x6
              speed   =~ x7 + x8 + x9 '
     
fit <- cfa(HS.model, data=HolzingerSwineford1939, group = "school")

# extract information
lavInspect(fit, "sampstat")
lavTech(fit, "sampstat")

Run the code above in your browser using DataLab