Learn R Programming

umx (version 1.4.0)

umxSetParameters: umxSetParameters

Description

Free or fix parameters in an mxModel. This allows similar actions that update enables for lm models. Updating can create duplicate labels, so this function also calls omxAssignFirstParameters to equate the start values for parameters which now have identical labels.

Usage

umxSetParameters(model, labels, free = NULL, values = NULL, newlabels = NULL, lbound = NULL, ubound = NULL, indep = FALSE, strict = TRUE, name = NULL, regex = FALSE, test = FALSE)

Arguments

model
an mxModel to WITH
labels
= labels to find
free
= new value for free
values
= new values
newlabels
= newlabels
lbound
= value for lbound
ubound
= value for ubound
indep
= whether to look in indep models
strict
whether to complain if labels not found
name
= new name for the returned model
regex
Is labels a regular expression (defaults to FALSE)
test
just show what you would do? (defaults to FALSE)

Value

- mxModel

Details

It also supports regular expressions to select labels. In this respect, it is similar to umxModify without running the model.

References

- https://github.com/tbates/umx, https://tbates.github.io

See Also

- umxModify, umxLabel

Other Modify or Compare Models: umxAdd1, umxDrop1, umxEquate, umxFixAll, umxGetParameters, umxMI, umxUnexplainedCausalNexus, umx

Examples

Run this code
require(umx)
data(demoOneFactor)
latents  = c("G")
manifests = names(demoOneFactor)
m1 <- umxRAM("One Factor", data = mxData(demoOneFactor[1:80,], type = "raw"),
	umxPath(from = latents, to = manifests),
	umxPath(v.m. = manifests),
	umxPath(v1m0 = latents)
)
parameters(m1, free=TRUE)
m2 = umxSetParameters(m1, "G_to_x1", newlabels= "G_to_x2", test = FALSE)
m2 = umxSetParameters(m1, "^", newlabels= "m1_", regex = TRUE, test = TRUE)

Run the code above in your browser using DataLab