Learn R Programming

lavaan (version 0.7-2)

lavTest: Test of exact fit

Description

Compute a variety of test statistics evaluating the global fit of the model.

Usage

lavTest(lavobject, test = "standard", scaled_test = "standard",
            output = "list", drop_list_single = TRUE, ...)

Value

If output = "list": a nested list with test statistics, or if only a single test statistic is requested (and

drop_list_single = TRUE), a list with details for this test statistic. If output = "text": the text is printed, and a nested list of test statistics (including an info attribute) is returned.

Arguments

lavobject

An object of class lavaan.

test

Character vector. Multiple names of test statistics can be provided. If "standard" is included, a conventional chi-square test is computed. If "Browne.residual.adf" is included, Browne's residual-based test statistic using ADF theory is computed. If "Browne.residual.nt" is included, Browne's residual-based test statistic using normal theory is computed. If "Satorra.Bentler" is included, a Satorra-Bentler scaled test statistic is computed. If "Yuan.Bentler" is included, a Yuan-Bentler scaled test statistic is computed. If "Yuan.Bentler.Mplus" is included, a test statistic is computed that is asymptotically equivalent to the Yuan-Bentler scaled test statistic. If "mean.var.adjusted" or "Satterthwaite" is included, a mean and variance adjusted test statistic is computed. If "scaled.shifted" is included, an alternative mean and variance adjusted test statistic is computed (as in Mplus version 6 or higher). If "mean.var.adjusted.corrected" (aliases: "mvc", "hayakawa") or "scaled.shifted.corrected" (alias: "ssc") is included, the corresponding test statistic is computed with the corrected (unbiased) estimator of the trace of the squared UGamma matrix (Hayakawa, 2018), which remains accurate when the number of observed variables is large relative to the sample size (where the naive estimator is severely biased, and the uncorrected adjusted tests underreject). These corrected tests are only available for single-group, single-level, complete, continuous data and estimator = "ML". Following Hayakawa (2018), they are best combined with scaled_test = "RLS". If "boot" or "bootstrap" or "Bollen.Stine" is included, the Bollen-Stine bootstrap is used to compute the bootstrap probability value of the (regular) test statistic. FMG p-value tests can be requested using names such as "peba4", "pols3", "pall", or "all". The convenience value "fmg" resolves to "peba4_rls" for one-model tests. Suffixless FMG names use the standard ML chi-square statistic by default; set scaled_test = "Browne.residual.nt.model" or scaled_test = "RLS" to use the Browne residual normal-theory model-based statistic. Suffixes such as "_ml", "_rls", and "_ug" can be used for explicit control, for example "peba4_ug_rls" or "pols3_ml".

scaled_test

Character. Choose the test statistic that will be scaled (if a scaled test statistic is requested). The default is "standard", but it could also be (for example) "Browne.residual.nt".

output

Character. If "list" (the default), return a list with all test statistics. If "text", display the output as text with verbose descriptions (as in the summary output). If any scaled test statistics are included, they are printed first in a two-column format, followed by the remaining test statistics in a one-column format.

drop_list_single

Logical. Only used when output = "list". If TRUE and the list is of length one (i.e. only a single test statistic), drop the outer list. If FALSE, return a nested list with one element per test statistic.

...

To support old argument names.

References

Hayakawa, K. (2019). Corrected goodness-of-fit test in covariance structure analysis. Psychological Methods, 24(3), 371--389. tools:::Rd_expr_doi("10.1037/met0000180")

Himeno, T., & Yamada, T. (2014). Estimations for some functions of covariance matrix in high dimension under non-normality and its applications. Journal of Multivariate Analysis, 130, 27--44.

Srivastava, M. S. (2005). Some tests concerning the covariance matrix in high dimensional data. Journal of the Japan Statistical Society, 35(2), 251--272.

Examples

Run this code
HS.model <- '
    visual  =~ x1 + x2 + x3
    textual =~ x4 + x5 + x6
    speed   =~ x7 + x8 + x9
'
fit <- cfa(HS.model, data = HolzingerSwineford1939)
lavTest(fit, test = "browne.residual.adf")
lavTest(fit, test = "peba4", output = "text")
lavTest(fit, test = "pols3", scaled_test = "RLS", output = "text")
# corrected adjusted test (Hayakawa, 2018), based on the RLS statistic
lavTest(fit, test = "mean.var.adjusted.corrected", scaled_test = "RLS",
        output = "text")

Run the code above in your browser using DataLab