inspectSampleCov: Observed Variable Covariance Matrix from a Model and Data

View source: R/zzz_OLDNAMES.R

lavInspectSampleCovR Documentation

Observed Variable Covariance Matrix from a Model and Data

Description

The lavaan model syntax describes a latent variable model. Often, the user wants to see the sample covariance matrix of the variables in their model for diagnostic purposes. However, their data may contain many more columns than the variables used in the model.

Usage

lavInspectSampleCov(model, data, ...)
inspectSampleCov(model, data, ...)

Arguments

model

The model that will be fit by lavaan.

data

The data frame being used to fit the model.

...

Other arguments to sem for how to deal with multiple groups, missing values, etc.

Details

One must supply both a model, coded with proper model.syntax, and a data frame from which a covariance matrix will be calculated. This function essentially calls sem without fitting the model, and then uses lavInspect to obtain the sample covariance matrix and the meanstructure.

See also

sem, lavInspect

Author(s)

Jarrett Byrnes


lavaan documentation built on Oct. 8, 2026, 5:06 p.m.