fitMeasures: Fit Measures for a Latent Variable Model

Description Usage Arguments Value Examples

Description

This function computes a variety of fit measures to assess the global fit of a latent variable model.

Usage

1
2
3
4
fitMeasures(object, fit.measures = "all", baseline.model = NULL, 
            output = "vector", ...)
fitmeasures(object, fit.measures = "all", baseline.model = NULL, 
            output = "vector", ...)

Arguments

object

An object of class lavaan.

fit.measures

If "all", all fit measures available will be returned. If only a single or a few fit measures are specified by name, only those are computed and returned.

baseline.model

If not NULL, an object of class lavaan, representing a user-specified baseline model. If a baseline model is provided, all fit indices relying on a baseline model (eg. CFI or TLI) will use the test statistics from this user-specified baseline model, instead of the default baseline model.

output

Character. If "vector" (the default), display the output as a named (lavaan-formatted) vector. If "matrix", display the output as a 1-column matrix. If "text", display the output using subsections and verbose descriptions. The latter is used in the summary output, and does not print the chi-square test by default. See the examples how to add the chi-square test in the output.

...

Further arguments passed to or from other methods. Not currently used for lavaan objects.

Value

A named numeric vector of fit measures.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
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")
print(fitMeasures(fit, c("chisq", "df", "pvalue", "cfi", "rmsea"),
                  output = "text"), add.h0 = TRUE)

Example output

This is lavaan 0.6-3
lavaan is BETA software! Please report any bugs.
               npar                fmin               chisq                  df 
             21.000               0.142              85.306              24.000 
             pvalue      baseline.chisq         baseline.df     baseline.pvalue 
              0.000             918.852              36.000               0.000 
                cfi                 tli                nnfi                 rfi 
              0.931               0.896               0.896               0.861 
                nfi                pnfi                 ifi                 rni 
              0.907               0.605               0.931               0.931 
               logl   unrestricted.logl                 aic                 bic 
          -3737.745           -3695.092            7517.490            7595.339 
             ntotal                bic2               rmsea      rmsea.ci.lower 
            301.000            7528.739               0.092               0.071 
     rmsea.ci.upper        rmsea.pvalue                 rmr          rmr_nomean 
              0.114               0.001               0.082               0.082 
               srmr        srmr_bentler srmr_bentler_nomean                crmr 
              0.065               0.065               0.065               0.073 
        crmr_nomean          srmr_mplus   srmr_mplus_nomean               cn_05 
              0.073               0.065               0.065             129.490 
              cn_01                 gfi                agfi                pgfi 
            152.654               0.943               0.894               0.503 
                mfi                ecvi 
              0.903               0.423 
  cfi 
0.931 
 chisq     df pvalue    cfi  rmsea 
85.306 24.000  0.000  0.931  0.092 
 chisq     df pvalue    cfi  rmsea 
85.306 24.000  0.000  0.931  0.092 
 chisq     df pvalue    cfi  rmsea 
85.306 24.000  0.000  0.931  0.092 

lavaan documentation built on March 10, 2021, 5:05 p.m.

Related to fitMeasures in lavaan...