Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

lavTestLRT

LRT test


Description

LRT test for comparing (nested) lavaan models.

Usage

lavTestLRT(object, ..., method = "default", A.method = "delta",
           scaled.shifted = TRUE,
           H1 = TRUE, type = "Chisq", model.names = NULL)
anova(object, ...)

Arguments

object

An object of class lavaan.

...

additional objects of class lavaan.

method

Character string. The possible options are "satorra.bentler.2001", "satorra.bentler.2010" and "satorra.2000". See details.

H1

Not used yet

A.method

Character string. The possible options are "exact" and "delta". This is only used when method = "satorra.2000". It determines how the Jacobian of the constraint function (the matrix A) will be computed. Note that if A.method = "exact", the models must be nested in the parameter sense, while if A.method = "delta", they only need to be nested in the covariance matrix sense.

scaled.shifted

Logical. Only used when method = "satorra.2000". If TRUE, we use a scaled and shifted test statistic; if FALSE, we use a mean and variance adjusted (Satterthwaite style) test statistic.

type

Character. If "Chisq", the test statistic for each model is the (scaled or unscaled) model fit test statistic. If "Cf", the test statistic for each model is computed by the lavTablesFitCf function.

model.names

Character vector. If provided, use these model names in the first column of the anova table.

Details

The anova function for lavaan objects simply calls the lavTestLRT function, which has a few additional arguments.

If type = "Chisq" and the test statistics are scaled, a special scaled difference test statistic is computed. If method is "satorra.bentler.2001", a simple approximation is used described in Satorra & Bentler (2001). In some settings, this can lead to a negative test statistic. To ensure a positive test statistic, we can use the method proposed by Satorra & Bentler (2010). Alternatively, when method is "satorra.2000", the original formulas of Satorra (2000) are used.

Value

An object of class anova. When given a single argument, it simply returns the test statistic of this model. When given a sequence of objects, this function tests the models against one another in the order specified.

References

Satorra, A. (2000). Scaled and adjusted restricted tests in multi-sample analysis of moment structures. In Heijmans, R.D.H., Pollock, D.S.G. & Satorra, A. (eds.), Innovations in multivariate statistical analysis. A Festschrift for Heinz Neudecker (pp.233-247). London: Kluwer Academic Publishers.

Satorra, A., & Bentler, P. M. (2001). A scaled difference chi-square test statistic for moment structure analysis. Psychometrika, 66(4), 507-514.

Satorra, A., & Bentler, P. M. (2010). Ensuring postiveness of the scaled difference chi-square test statistic. Psychometrika, 75(2), 243-248.

Examples

HS.model <- '
    visual  =~ x1 + b1*x2 + x3
    textual =~ x4 + b2*x5 + x6
    speed   =~ x7 + b3*x8 + x9
'
fit1 <- cfa(HS.model, data = HolzingerSwineford1939)
fit0 <- cfa(HS.model, data = HolzingerSwineford1939, 
            orthogonal = TRUE)
lavTestLRT(fit1, fit0)

lavaan

Latent Variable Analysis

v0.6-10
GPL (>= 2)
Authors
Yves Rosseel [aut, cre] (<https://orcid.org/0000-0002-4129-4477>), Terrence D. Jorgensen [aut] (<https://orcid.org/0000-0001-5111-6773>), Nicholas Rockwood [aut] (<https://orcid.org/0000-0001-5931-183X>), Daniel Oberski [ctb], Jarrett Byrnes [ctb], Leonard Vanbrabant [ctb], Victoria Savalei [ctb], Ed Merkle [ctb], Michael Hallquist [ctb], Mijke Rhemtulla [ctb], Myrsini Katsikatsou [ctb], Mariska Barendse [ctb], Florian Scharf [ctb], Han Du [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.