Learn R Programming

umx (version 1.4.0)

umxRun: umxRun

Description

umxRun is a version of mxRun which can run also set start values, labels, and run multiple times It can also calculate the saturated and independence likelihoods necessary for most fit indices.

Usage

umxRun(model, n = 1, calc_SE = TRUE, calc_sat = TRUE, setValues = FALSE, setLabels = FALSE, intervals = FALSE, comparison = NULL, setStarts = NULL)

Arguments

model
The mxModel you wish to run.
n
The maximum number of times you want to run the model trying to get a code green run (defaults to 1)
calc_SE
Whether to calculate standard errors (not used when n = 1) for the summary (they are not very accurate, so if you use mxCI or umxCI, you can turn this off)
calc_sat
Whether to calculate the saturated and independence models (for raw mxData mxModels) (defaults to TRUE - why would you want anything else?)
setValues
Whether to set the starting values of free parameters (defaults to F)
setLabels
Whether to set the labels (defaults to F)
intervals
Whether to run mxCI confindence intervals (defaults to F)
comparison
Whether to run umxCompare() after umxRun
setStarts
Deprecated way to setValues

Value

- mxModel

References

- http://www.github.com/tbates/umx

See Also

Other Model Building Functions: umxDiagnose, umxLabel, umxLatent, umxMatrix, umxModify, umxPath, umxRAM2Ordinal, umxRAM, umxThresholdMatrix, umxValues, umx_fix_first_loadings, umx_fix_latents, umx

Examples

Run this code
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) # just run: will create saturated model if needed
m1 = umxRun(m1, setValues = TRUE, setLabels = TRUE) # set start values and label all parameters
umxSummary(m1, show = "std")
m1 = mxModel(m1, mxCI("G_to_x1")) # add one CI
m1 = mxRun(m1, intervals = TRUE)
residuals(m1, run = TRUE) # get CIs on all free parameters
confint(m1, run = TRUE) # get CIs on all free parameters
m1 = umxRun(m1, n = 10) # re-run up to 10 times if not green on first run

Run the code above in your browser using DataLab