Learn R Programming

umx (version 4.9.0)

umxEquate: umxEquate: Equate two or more paths

Description

In addition to dropping or adding parameters, a second common task in modeling is to equate parameters. umx provides a convenience function to equate parameters by setting one or more parameters (the "slave" set) equal to one or more "master" parameters. These parameters are picked out via their labels, and setting two or more parameters to have the same value is accomplished by setting the slave(s) to have the same label(s) as the master parameters, thus constraining them to take the same value during model fitting.

Usage

umxEquate(
  model,
  a,
  b,
  newlabels = NULL,
  free = c(TRUE, FALSE, NA),
  verbose = FALSE,
  name = NULL,
  autoRun = FALSE,
  tryHard = c("no", "yes", "ordinal", "search"),
  comparison = TRUE,
  master = NULL,
  slave = NULL
)

Arguments

model

An mxModel() within which to equate parameters listed in "a" with those in "b"

a

one or more parameter labels to equate with b labels

b

one or more labels to equate (if newNames is not set, these will set to the a labels, thus equating the parameters

newlabels

(optional) list of new labels for the equated parameters.

free

Should parameter(s) initially be free? (default = TRUE)

verbose

Whether to give verbose feedback (default = TRUE)

name

name for the returned model (optional: Leave empty to leave name unchanged)

autoRun

Whether to run the model (default), or just to create it and return without running.

tryHard

Default ('no') uses normal mxRun. "yes" uses mxTryHard. Other options: "ordinal", "search"

comparison

Compare the new model to the old (if updating an existing model: default = TRUE)

master

A list of "master" labels to which slave labels will be equated

slave

A list of slave labels which will be updated to match master labels, thus equating the parameters

Value

Details

note: In addition to using this method to equating parameters, you can also equate one parameter to another by setting its label to the "square bracket" address of the master, e.g. "a[r,c]".

Tip: To find labels of free parameters use umxGetParameters() with free = TRUE

Tip: To find labels by name, use the regex parameter of umxGetParameters()

References

See Also

umxModify(), umxCompare()

Other Model Summary and Comparison: umxCompare(), umxMI(), umxReduce(), umxSetParameters(), umxSummary(), umx

Examples

Run this code
# NOT RUN {
require(umx)
data(demoOneFactor)
manifests = names(demoOneFactor)
m1 = umxRAM("One Factor", data = demoOneFactor, type = "cov",
	umxPath("G", to = manifests),
	umxPath(var = manifests),
	umxPath(var = "G", fixedAt = 1)
)
# By default, umxEquate just equates master and slave labels: doesn't run model
m2 = umxEquate(m1, a = "G_to_x1", b = "G_to_x2", name = "Eq x1 x2 loadings")

# Set autoRun = TRUE and comparison = TRUE to run and output a comparison
m2 = umxEquate(m1, autoRun = TRUE, comparison = TRUE, name = "Eq_x1_x2",
	     a = "G_to_x1", b = "G_to_x2"
)

# rename the equated paths
m2 = umxEquate(m1, autoRun = TRUE, comparison = TRUE, name = "Eq_x1_x2",
	     a = "G_to_x1", b = "G_to_x2", newlabels = c("equated")
)
parameters(m2)
# }

Run the code above in your browser using DataLab