Learn R Programming

umx (version 1.9.1)

residuals.MxModel: Get residuals from an MxModel

Description

Return the residuals from an OpenMx RAM model. You can format these (with digits), and suppress small values.

Usage

# S3 method for MxModel
residuals(object, digits = 2, suppress = NULL, ...)

Arguments

object

An fitted mxModel from which to get residuals

digits

round to how many digits (default = 2)

suppress

smallest deviation to print out (default = NULL = show all)

...

Optional parameters

Value

- matrix of residuals

References

- http://tbates.github.io, https://github.com/tbates/umx

See Also

Other Reporting functions: RMSEA.MxModel, RMSEA.summary.mxmodel, RMSEA, extractAIC.MxModel, loadings, plot.MxModel, umxCI_boot, umxCI, umxCompare, umxConfint, umxExpCov, umxExpMeans, umxFitIndices, umxPlotACEcov, umxPlotACEv, umxPlotACE, umxPlotCP, umxPlotGxE, umxPlotIP, umxSummary.MxModel, umxSummaryACEv, umxSummaryACE, umx_drop_ok, umx_standardize_RAM

Examples

Run this code
# NOT RUN {
require(umx)
data(demoOneFactor)
latents  = c("g")
manifests = names(demoOneFactor)
m1 <- 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(cov(demoOneFactor), type = "cov", numObs = 500)
)
m1 = umxRun(m1, setLabels = TRUE, setValues = TRUE)
residuals(m1)
residuals(m1, digits = 3)
residuals(m1, digits = 3, suppress = .005)
# residuals are returned as an invisible object you can capture in a variable
a = residuals(m1); a
# }

Run the code above in your browser using DataLab