fitMeasuresMx {semTools}R Documentation

Find fit measures from an MxModel result

Description

Find fit measures from MxModel result. The saturate and null models are analyzed in the function and fit measures are calculated based on the comparison with the null and saturate models. The function is adjusted from the fitMeasures function in the lavaan package.

Usage

fitMeasuresMx(object, fit.measures="all")

Arguments

object

The target MxModel object

fit.measures

Target fit measures

Value

A vector of fit measures

Author(s)

The original function is the fitMeasures function written by Yves Rosseel in the lavaan package. The function is adjusted for an MxModel object by Sunthud Pornprasertmanit (psunthud@gmail.com)

See Also

nullMx, saturateMx, standardizeMx

Examples

## Not run: 
library(OpenMx)
data(demoOneFactor)
manifests <- names(demoOneFactor)
latents <- c("G")
factorModel <- mxModel("One Factor", 
    type="RAM",
    manifestVars=manifests, 
    latentVars=latents,
    mxPath(from=latents, to=manifests),
    mxPath(from=manifests, arrows=2),
    mxPath(from=latents, arrows=2, free=FALSE, values=1.0),
    mxData(observed=cov(demoOneFactor), type="cov", numObs=500)
)
factorFit <- mxRun(factorModel)
round(fitMeasuresMx(factorFit), 3)

# Compare with lavaan
library(lavaan)
script <- "f1 =~ x1 + x2 + x3 + x4 + x5"
fitMeasures(cfa(script, sample.cov = cov(demoOneFactor), sample.nobs = 500, std.lv = TRUE))

## End(Not run)

[Package semTools version 0.4-14 Index]