show_cfi | R Documentation |
Show how CFI and TLI are computed using a graph of model chi-square vs. model degrees of freedom.
show_cfi(fit, ...)
show_tli(fit, ...)
show_ifi(fit, fit_measures = c("cfi", "tli"), test = c("standard"))
fit |
An output of
|
... |
Arguments to be passed to |
fit_measures |
The fit measures
to be plotted. Acceptable values are
|
test |
The type of model
chi-square test. It corresponds
to the |
This function receives an
output of lavaan::lavaan()
or its
wrappers (e.g., lavaan::cfa()
and lavaan::sem()
) and
illustrates how CFI is computed.
An output of
ggplot2::ggplot()
that can be
further modified.
show_cfi()
: A wrapper of show_ifi()
with fit_measures = "cfi"
.
show_tli()
: A wrapper of show_ifi()
with fit_measures = "tli"
.
Shu Fai Cheung https://orcid.org/0000-0002-9871-9448
library(lavaan)
# From the help page of lavaan::cfa().
HS.model <- '
visual =~ x1 + x2 + x3
textual =~ x4 + x5 + x6
speed =~ x7 + x8 + x9
'
fit <- cfa(HS.model, data = HolzingerSwineford1939)
# By default show how CFI is computed
show_ifi(fit)
# Show how TLI is computed
show_ifi(fit, fit_measures = "tli")
# Wrappers
show_cfi(fit)
show_tli(fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.