Learn R Programming

umx (version 1.9.1)

umxCI: Add (and, optionally, run) confidence intervals to a structural model.

Description

umxCI adds mxCI() calls for all free parameters in a model, runs the CIs, and reports a neat summary.

Usage

umxCI(model = NULL, which = c("ALL", NA, "list of your making"),
  remove = FALSE, run = c("no", "yes", "if necessary", "show"),
  interval = 0.95, type = c("both", "lower", "upper"),
  showErrorCodes = TRUE)

Arguments

model

The mxModel you wish to report mxCIs on

which

What CIs to add: c("ALL", NA, "list of your making")

remove

= FALSE (if set, removes existing specified CIs from the model)

run

Whether or not to compute the CIs. Valid values = "no" (default), "yes", "if necessary". 'show' means print the intervals if computed, or list their names if not.

interval

The interval for newly added CIs (defaults to 0.95)

type

The type of CI (defaults to "both", options are "lower" and "upper")

showErrorCodes

Whether to show errors (default == TRUE)

Value

- mxModel

Details

This function also reports any problems computing a CI. The codes are standard OpenMx errors and warnings

  • 1: The final iterate satisfies the optimality conditions to the accuracy requested, but the sequence of iterates has not yet converged. NPSOL was terminated because no further improvement could be made in the merit function (Mx status GREEN)

  • 2: The linear constraints and bounds could not be satisfied. The problem has no feasible solution.

  • 3: The nonlinear constraints and bounds could not be satisfied. The problem may have no feasible solution.

  • 4: The major iteration limit was reached (Mx status BLUE).

  • 6: The model does not satisfy the first-order optimality conditions to the required accuracy, and no improved point for the merit function could be found during the final linesearch (Mx status RED)

  • 7: The function derivatives returned by funcon or funobj appear to be incorrect.

  • 9: An input parameter was invalid

If runCIs is FALSE, the function simply adds CIs to be computed and returns the model.

References

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

See Also

- mxCI, umxLabel, umxRun

Other Reporting functions: RMSEA.MxModel, RMSEA.summary.mxmodel, RMSEA, extractAIC.MxModel, loadings, plot.MxModel, residuals.MxModel, umxCI_boot, 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 <- umxRAM("One Factor", data = mxData(cov(demoOneFactor), type = "cov", numObs = 500),
	umxPath(latents, to = manifests),
	umxPath(var = manifests),
	umxPath(var = latents, fixedAt = 1)
)
m1$intervals # none yet list()
m1 = umxCI(m1)
m1$intervals # $G_to_x1
m1 = umxCI(m1, remove = TRUE) # Add CIs for all free parameters, and return model
data(twinData) 
selDVs = c("bmi1","bmi2")
mzData <- as.matrix(subset(twinData, zygosity == "MZFF", selDVs))
dzData <- as.matrix(subset(twinData, zygosity == "DZFF", selDVs))
m1 = umxACE(selDVs = selDVs, dzData = dzData, mzData = mzData)
# }
# NOT RUN {
umxCI(m1, run = "show") # show what will be requested
umxCI(m1, run = "yes") # actually compute the CIs
# Don't force update of CIs, but if they were just added, then calculate them
umxCI(m1, run = "if necessary")
m1 = umxCI(m1, remove = TRUE) # remove them all
m1$intervals # none!
umxParameters(m1) # see what's available
m1 = umxCI(m1, "a_r1c1", run = "yes")
# }

Run the code above in your browser using DataLab