fit_lavaan: Get the lavaan fit indexes in tidy format

View source: R/fit_lavaan.R

fit_lavaanR Documentation

Get the lavaan fit indexes in tidy format

Description

fit_lavaan allows to extract the fit indexes of a factorial model estimated with lavaan. The main feature of this function is that, if the estimator is robust, the fit indexes obtained will be the robust ones.

Usage

fit_lavaan(x)

Arguments

x

A lavaan object that is estimated by lavaan::cfa() or lavaan::sem().

Value

A tibble::tibble() with a row and each estimated parameter in a column

nobs

Number of analysed observations

estimator

Estimator used

ngroups

Number of groups in model

converged

Logical indicator about the convergence of the model

chisq

Model chi squared

df

degrees of freedom

pvalue

P-value associated with the model

npar

Number of parameters in the model

CFI

Comparative Fit Index

TLI

Tucker-Lewis Index also known as NNFI

RMSEA

Root Mean Square error of Approximation

RMSEA.CI.LOWER

95 percent lower bound on RMSEA

RMSEA.CI.UPPER

95 percent upper bound on RMSEA

SRMR

Standardized Root Mean squared Residual

WRMR

Weighted Root Mean Square Residual

AIC

Akaike information criterion

BIC

Bayesian information criterion

missing_method

Method for eliminating missing data

See Also

lavaan::cfa(), lavaan::sem(), lavaan::fitmeasures()

Examples


library(lavaan)

HS.model <- " visual  =~ x1 + x2 + x3
              textual =~ x4 + x5 + x6
              speed   =~ x7 + x8 + x9 "

fit <- cfa(
  model = HS.model,
  data = HolzingerSwineford1939
)

fit_lavaan(fit)

brianmsm/antools documentation built on Feb. 13, 2023, 3:07 a.m.