resid_fit: Residual fit indices

Description Usage Arguments Value Details Examples

View source: R/resid_fit.R

Description

Computes the RMR, SRMR, and CRMR.

Usage

1
2
3
4
5
6
7
8
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

1
2
3
4
5
6
7
8
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)

glvmfit documentation built on Aug. 6, 2021, 9:07 a.m.

Related to resid_fit in glvmfit...