annotate_matrices {semhelpinghands}R Documentation

Annotate the Matrices of a 'lavaan' Model

Description

Label the elements of the model matrices in a lavaan model.

Usage

annotate_matrices(fit)

## S3 method for class 'annotate_matrices'
print(x, ...)

Arguments

fit

The output of lavaan::lavaan() or its wrappers, such as lavaan::cfa() and lavaan::sem().

x

A 'annotate_matrices'-class object. The output of annotate_matrices().

...

Optional arguments. To be passed to the default print method.

Details

This function annotates the model matrices in a lavaan object. This function is not to be used in analysis. It is a learning tool, for learners to understand the relation between the model matrices and the model parameters.

It currently supports a single-level single-group model only.

Value

annotate_matrices() returns an annotate_matrices-class object, which is a list of model matrices, with elements annotated:

The print-method return the input, x. It was called for its side-effect.

Methods (by generic)

Author(s)

Shu Fai Cheung https://orcid.org/0000-0002-9871-9448

Examples


# Adapted from https://lavaan.ugent.be/tutorial/cfa.html

library(lavaan)
HS.model <- '
visual  =~ x1 + x2 + x3
textual =~ x4 + x5 + x6
speed   =~ x7 + x8 + x9
'
fit_cfa <- cfa(HS.model,
               data = HolzingerSwineford1939)
annotate_matrices(fit_cfa)


[Package semhelpinghands version 0.1.11 Index]