resid_fit {glvmfit}R Documentation

Residual fit indices

Description

Computes the RMR, SRMR, and CRMR.

Usage

resid_fit(
  S = NULL,
  Sigma = NULL,
  ybar = NULL,
  mu = NULL,
  lavaan_object = NULL,
  exo = TRUE
)

Arguments

S

sample covariance matrix

Sigma

model-implied covariance matrix

ybar

sample mean vector

mu

model-implied mean vector

lavaan_object

is a fitted model of class lavaan

exo

boolean argument indicating if model has exogenous covariates

Value

An S4 object

Details

S, Sigma, ybar, and mu must be of the same dimensions.

If the sum of the diagonal elements of S equals the sum of the diagonal elements of Sigma the variance component of SRMR is not included

If the sum of the sample means yhat equals the sum of the model-implied means mu the mean component of SRMR is not included

Examples

Sigma <- matrix(c(1.022, .550,  .622, .550, .928, .783, .622, .783, 1.150), 
                    nrow = 3)
S <- matrix(c(.770, .545, .515, .545, 1.003, .890, .515, .890, 1.211), 
            nrow = 3)
ybar <- c(2.516, 4.041, 5.021)
mu <- c(2.825, 3.877, 4.929)

resid_fit(S = S,  Sigma = Sigma, ybar = ybar, mu = mu)


[Package glvmfit version 0.1.0 Index]