| fitMeasures | R Documentation |
This function computes a variety of fit measures to assess the global fit of a latent variable model.
## S4 method for signature 'lavaan'
fitMeasures(object, fit_measures = "all",
baseline_model = NULL, h1_model = NULL,
fm_args = list(standard_test = "default",
scaled_test = "default",
rmsea_ci_level = 0.90,
rmsea_close_h0 = 0.05,
rmsea_notclose_h0 = 0.08,
robust = TRUE,
cat_nonpd = "na"),
output = "vector", level = NULL, ...)
## S4 method for signature 'lavaan'
fitmeasures(object, fit_measures = "all",
baseline_model = NULL, h1_model = NULL,
fm_args = list(standard_test = "default",
scaled_test = "default",
rmsea_ci_level = 0.90,
rmsea_close_h0 = 0.05,
rmsea_notclose_h0 = 0.08,
robust = TRUE,
cat_nonpd = "na"),
output = "vector", level = NULL, ...)
object |
An object of class |
fit_measures |
If |
baseline_model |
If not NULL, an object of class
|
h1_model |
If not NULL, an object of class |
fm_args |
List. Additional options for certain fit measures. DEPRECATED.
The options should now be specified in the |
output |
Character. If |
level |
Only used for multilevel models. If not |
... |
Further arguments passed to or from other methods. Not currently
used for |
When a scaled (or robust) test statistic is requested (for example, by using
test = "satorra.bentler"), the function will also return fit indices
based on the scaled chi-square statistic, rather than the standard version.
These scaled versions of fit measures, such as CFI and RMSEA, are calculated in
the same way as their standard counterparts, with the key difference being that
the scaled chi-square statistic is used in place of the regular one. In the
output of fitMeasures(), these appear with the .scaled suffix,
or in the Scaled column of the summary() output.
However, this substitution-based approach—used in SEM software for many
years—has since been shown to be incorrect. Improved versions of robust fit
indices have been proposed, offering better theoretical properties. Although
still under development and not yet implemented for all estimation settings,
these improved robust fit measures are provided when available. They appear
with a .robust suffix in the output of fitMeasures(), or in the
Scaled column of the summary() output on a row labeled
Robust. As a general recommendation, these newer robust versions should
be used whenever available, in preference to the older scaled ones. See the
references below for more details.
It is also worth noting that, for models involving ordered categorical data,
robust fit indices are only computed if the underlying matrix of tetrachoric or
polychoric correlations is positive definite. If this condition is not
met—which is not uncommon in small samples—the robust measures are reported
as NA.
Finally, in some situations (especially when the data contains missing values),
computing these robust fit indices may be computationally intensive. To avoid
long runtimes, the calculation of robust fit measures can be disabled by
setting the robust argument to FALSE in the fit_measures list.
FMG p-values can be selected through the existing standard_test
mechanism, for example
fitMeasures(fit, "pvalue", fm_args = list(standard_test = "peba4")).
No separate FMG-specific fit-measure names are needed.
For models fitted with sam using a local sam_method
("local", "fsr" or "cfsr"), the fit measures are
computed for the step-2 structural model only, conditional on the (fixed)
measurement model of step 1; loglikelihood-based measures (aic, bic, ...)
are not available. If sam_method = "global", the fit measures are
based on the joint model; since the parameters were estimated using a
two-step procedure, they should be interpreted with caution.
A named numeric vector of fit measures (or a list, a matrix, or a
pretty-printed text version, depending on the output argument).
If all (default) fit measures are requested (and output is not
"list"), or if output = "text", the result carries two
(hidden) attributes that record
which test statistic(s) the fit measures are based on (intended for
developers): "standard.test" (always present; e.g.
"standard" or "browne.residual.nt.model"), and
"scaled.test" (only present if a scaled test statistic was used;
e.g. "satorra.bentler"). Before 0.7-3, "standard.test"
was only set if the test was not "standard". If an explicit
subset of fit measures is requested (e.g. fitMeasures(fit, "cfi")),
the (vector or matrix) result has no attributes (other than the names),
as before.
Ryu, E., & West, S. G. (2009). Level-specific evaluation of model fit in multilevel structural equation modeling. Structural Equation Modeling, 16(4), 583–601. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/10705510903203466")}
Brosseau-Liard, P. E., Savalei, V., & Li, L. (2012). An investigation of the sample performance of two nonnormality corrections for RMSEA. Multivariate behavioral research, 47(6), 904-930. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/00273171.2012.715252")}
Brosseau-Liard, P. E., & Savalei, V. (2014). Adjusting incremental fit indices for nonnormality. Multivariate behavioral research, 49(5), 460-470. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/00273171.2014.933697")}
Savalei, V. (2018). On the computation of the RMSEA and CFI from the mean-and-variance corrected test statistic with nonnormal data in SEM. Multivariate behavioral research, 53(3), 419-429. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/00273171.2018.1455142")}
Savalei, V. (2021). Improving fit indices in structural equation modeling with categorical data. Multivariate Behavioral Research, 56(3), 390-407. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/00273171.2020.1717922")}
Savalei, V., Brace, J. C., & Fouladi, R. T. (2023). We need to change how we compute RMSEA for nested model comparisons in structural equation modeling. Psychological Methods. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1037/met0000537")}
Zhang, X., & Savalei, V. (2023). New computations for RMSEA and CFI following FIML and TS estimation with missing data. Psychological Methods, 28(2), 263-283. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1037/met0000445")}
Foldnes, N., Moss, J., & Gronneberg, S. (2024). Improved goodness of fit procedures for structural equation models. Structural Equation Modeling: A Multidisciplinary Journal, 1-13. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/10705511.2024.2372028")}
Foldnes, N., Gronneberg, S., & Moss, J. (2026). Penalized eigenvalue block averaging: Extension to nested model comparison and Monte Carlo evaluations. Behavior Research Methods, 58(4). \Sexpr[results=rd]{tools:::Rd_expr_doi("10.3758/s13428-026-02968-4")}
HS.model <- ' visual =~ x1 + x2 + x3
textual =~ x4 + x5 + x6
speed =~ x7 + x8 + x9 '
fit <- cfa(HS.model, data = HolzingerSwineford1939)
fitMeasures(fit)
fitMeasures(fit, "cfi")
fitMeasures(fit, c("chisq", "df", "pvalue", "cfi", "rmsea"))
fitMeasures(fit, c("chisq", "df", "pvalue", "cfi", "rmsea"),
output = "matrix")
fitMeasures(fit, c("chisq", "df", "pvalue", "cfi", "rmsea"),
output = "text")
fitMeasures(fit, "pvalue", fm_args = list(standard_test = "peba4"))
## specify another threshold for RMSEA confidence interval
fitMeasures(fit, list(
fit_measures = c("cfi", "rmsea"),
rmsea_ci_level = 0.95))
## fit a more restricted model
fit0 <- cfa(HS.model, data = HolzingerSwineford1939, orthogonal = TRUE)
## Calculate RMSEA_D (Savalei et al., 2023)
## See https://psycnet.apa.org/doi/10.1037/met0000537
fitMeasures(fit0, "rmsea", h1_model = fit)
## level-specific fit measures for a multilevel model (Ryu & West, 2009)
model <- '
level: 1
fw =~ y1 + y2 + y3
fw ~ x1 + x2 + x3
level: 2
fb =~ y1 + y2 + y3
fb ~ w1 + w2
'
fit2l <- sem(model, data = Demo.twolevel, cluster = "cluster")
fitMeasures(fit2l, c("chisq", "df", "pvalue", "cfi", "rmsea",
"srmr_within"), level = "within")
fitMeasures(fit2l, c("chisq", "df", "pvalue", "cfi", "rmsea",
"srmr_between"), level = "between")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.