
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.
Note this is not needed for umxRAM models or twin models - it is just a convenience to get base OpenMx models to run.
umxRun(
model,
n = 1,
calc_SE = TRUE,
calc_sat = TRUE,
setValues = FALSE,
setLabels = FALSE,
intervals = FALSE,
comparison = NULL
)
The mxModel()
you wish to run.
The maximum number of times you want to run the model trying to get a code green run (defaults to 1)
Whether to set the starting values of free parameters (default = FALSE)
Whether to set the labels (default = FALSE)
Whether to run mxCI confidence intervals (default = FALSE) intervals = FALSE
Whether to run umxCompare() after umxRun
Other Advanced Model Building Functions:
umxAlgebra()
,
umxFixAll()
,
umxJiggle()
,
umxThresholdMatrix()
,
umxUnexplainedCausalNexus()
,
umx
,
xmuLabel()
,
xmuValues()
# 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) # just run: will create saturated model if needed
# }
# NOT RUN {
m1 = umxRun(m1, setValues = TRUE, setLabels = TRUE) # set start values and label all parameters
umxSummary(m1, std = TRUE)
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) # OpenMx's SE-based CIs
umxConfint(m1, run = TRUE) # get likelihood-based CIs on all free parameters
m1 = umxRun(m1, n = 10) # re-run up to 10 times if not green on first run
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab