Learn R Programming

umx (version 1.4.0)

umxLabel: umxLabel

Description

umxLabel adds labels to things, be it an: mxModel (RAM or matrix based), an mxPath, or an mxMatrix This is a core function in umx: Adding labels to paths opens the door to umxEquate, as well as omxSetParameters

Usage

umxLabel(obj, suffix = "", baseName = NA, setfree = FALSE, drop = 0, labelFixedCells = TRUE, jiggle = NA, boundDiag = NA, verbose = FALSE, overRideExisting = FALSE)

Arguments

obj
An mxModel (RAM or matrix based), mxPath, or mxMatrix
suffix
String to append to each label (might be used to distinguish, say male and female submodels in a model)
baseName
String to prepend to labels. Defaults to NA ("")
setfree
Whether to label only the free paths (defaults to FALSE)
drop
The value to fix "drop" paths to (defaults to 0)
labelFixedCells
= TRUE
jiggle
How much to jiggle values in a matrix or list of path values
boundDiag
Whether to bound the diagonal of a matrix
verbose
How much feedback to give the user (default = FALSE)
overRideExisting
= FALSE

Value

- mxModel

References

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

See Also

Other Model Building Functions: umxDiagnose, umxLatent, umxMatrix, umxModify, umxPath, umxRAM2Ordinal, umxRAM, umxRun, 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),
	mxData(cov(demoOneFactor), type = "cov", numObs = 500)
)
umxGetParameters(m1) # Default "matrix address" labels, i.e "One Factor.S[2,2]"
m1 = umxLabel(m1)
umxGetParameters(m1, free = TRUE) # Informative labels: "G_to_x1", "x4_with_x4", etc.
# Labeling a matrix
a = umxLabel(mxMatrix(name = "a", "Full", 3, 3, values = 1:9))
a$labels
# labels with "data." in the name are left alone
a = mxMatrix(name = "a", "Full", 1,3, labels = c("data.a", "test", NA))
umxLabel(a, verbose = TRUE)
umxLabel(a, verbose = TRUE, overRideExisting = FALSE)
umxLabel(a, verbose = TRUE, overRideExisting = TRUE)
umxLabel(a, verbose = TRUE, overRideExisting = TRUE)

Run the code above in your browser using DataLab