umxConfint: Get confidence intervals from a umx model

umxConfintR Documentation

Get confidence intervals from a umx model

Description

Implements confidence interval function for umx models.

Usage

umxConfint(
  object,
  parm = c("existing", "all", "or one or more labels", "smart"),
  wipeExistingRequests = TRUE,
  level = 0.95,
  run = FALSE,
  showErrorCodes = FALSE,
  optimizer = c("SLSQP", "NPSOL", "CSOLNP", "current")
)

Arguments

object

An OpenMx::mxModel(), possibly already containing OpenMx::mxCI()s that have been OpenMx::mxRun() with intervals = TRUE))

parm

Which parameters to get confidence intervals for. Can be "existing", "all", or one or more parameter names.

wipeExistingRequests

Whether to remove existing CIs when adding new ones (ignored if parm = 'existing').

level

The confidence level required (default = .95)

run

Whether to run the model (defaults to FALSE)

showErrorCodes

(default = FALSE)

optimizer

For difficult CIs, trying other optimizers can help!

Details

Note: By default, requesting new CIs wipes the existing ones. To keep these, set wipeExistingRequests = FALSE.

Because CIs can take time to run, by default only already-computed CIs will be reported. To run new CIs, set run = TRUE .

Note: OpenMx defines a confint function which will return SE-based CIs.

If parm is empty, and run = FALSE, a message will alert you to set run = TRUE.

Value

  • OpenMx::mxModel()

References

See Also

  • stats::confint(), OpenMx::mxSE(), umxCI(), OpenMx::mxCI()

Other Reporting functions: RMSEA(), RMSEA.MxModel(), RMSEA.summary.mxmodel(), extractAIC.MxModel(), loadings(), loadings.MxModel(), residuals.MxModel(), tmx_show(), tmx_show.MxMatrix(), umxCI(), umxCI_boot(), umxExpCov(), umxExpMeans(), umxFitIndices(), umxRotate()

Examples

## Not run: 
require(umx)
data(demoOneFactor)

manifests = names(demoOneFactor)
m1 = umxRAM("OneFactor", data = demoOneFactor, type = "cov",
	umxPath(from = "G", to = manifests),
	umxPath(var = manifests),
	umxPath(var = "G", fixedAt = 1)
)

m1 = umxConfint(m1, run = TRUE) # There are no existing CI requests...

# Add a CI request for "G_to_x1", run, and report. Save with this CI computed
m2 = umxConfint(m1, parm = "G_to_x1", run = TRUE) 

# Just print out any existing CIs
umxConfint(m2)

# CI requests added for free matrix parameters. User prompted to set run = TRUE
m3 = umxConfint(m1, "all")

# Run the requested CIs
m3 = umxConfint(m3, run = TRUE) 

# Run CIs for free one-headed (asymmetric) paths in RAM model. 
#   note: Deletes other existing requests,
tmp = umxConfint(m1, parm = "A", run = TRUE)

# Wipe existing CIs, add G_to_x1
tmp = umxConfint(m1, parm = "G_to_x1", run = TRUE, wipeExistingRequests = TRUE) 

# For some twin models, a "smart" mode is implemented
# note: only implemented for umxCP so far
m2 =  umxConfint(m1, "smart")

## End(Not run)


tbates/umx documentation built on Dec. 14, 2024, 11:28 a.m.