R: Class For Representing A Template of Model Fit Comparisons

FitDiff-class {semTools} | R Documentation

## Class For Representing A Template of Model Fit Comparisons

### Description

This class contains model fit measures and model fit comparisons among multiple models

### Usage

    ## S4 method for signature 'FitDiff'
    show(object)

    ## S4 method for signature 'FitDiff'
    summary(object, fit.measures = "default")

### Arguments

`object` | object of class `FitDiff`
`fit.measures` | `character` vector naming fit indices the user can request from `fitMeasures`. If `"default"`, the fit measures will be `c("chisq", "df", "pvalue", "cfi", "tli", "rmsea", "srmr", "aic", "bic")`. If `"all"`, all available fit measures will be returned.

### Slots

`name`

  The name of each model

`nested`

  Model fit comparisons between adjacent nested models that are ordered based on their degrees of freedom (df)

`ordernested`

  The order of nested models regarding to their df

`fit`

  Fit measures of all models specified in the `name` slot

### Objects from the Class

Objects can be created via the `compareFit` function.

### Author(s)

Sunthud Pornprasertmanit (psunthud@gmail.com)

### See Also

`compareFit`; `clipboard`

### Examples

    HW.model <- ' visual =~ x1 + x2 + x3
                  textual =~ x4 + x5 + x6
                  speed =~ x7 + x8 + x9 '

    out <- measurementInvariance(model = HW.model, data = HolzingerSwineford1939,
                                 group = "school", quiet = TRUE)
    modelDiff <- compareFit(out)
    summary(modelDiff)
    summary(modelDiff, fit.measures = "all")
    summary(modelDiff, fit.measures = c("aic", "bic"))

    ## Not run:
    ## Save results to a file
    saveFile(modelDiff, file = "modelDiff.txt")

    ## Copy to a clipboard
    clipboard(modelDiff)

    ## End(Not run)

[Package semTools version 0.5-0 Index]