umxGetModel {umx} | R Documentation |
Used to get a RAM submodel by name
Description
Get any model from a RAM model, including submodels.
Usage
umxGetModel(model, targetModel = NULL)
Arguments
model |
a |
targetModel |
name of the model to extract from |
Value
model
See Also
Other Reporting Functions:
umxAPA()
,
umxFactorScores()
,
umxGetLatents()
,
umxGetManifests()
,
umxGetParameters()
,
umxParameters()
,
umx_aggregate()
,
umx_time()
,
umx
Examples
## Not run:
library(umx)
# Create two sets of data in which X & Y correlate ~ .4 in both datasets.
manifests = c("x", "y")
tmp = umx_make_TwinData(nMZpairs = 100, nDZpairs = 150,
AA = 0, CC = .4, EE = .6, varNames = manifests)
grp1 = tmp[tmp$zygosity == "MZ", manifests]
g1Data = mxData(cov(grp1), type = "cov", numObs = nrow(grp1), means=umx_means(grp1))
grp2 = tmp[tmp$zygosity == "DZ", manifests]
g2Data = mxData(cov(grp2), type = "cov", numObs = nrow(grp2), means=umx_means(grp2))
# Model 1 (could add autoRun = FALSE if you don't want to run this as it is being built)
m1 = umxRAM("m1", data = g1Data,
umxPath("x", to = "y", labels = "beta"),
umxPath(var = manifests, labels = c("Var_x", "Resid_y_grp1")),
umxPath(means = manifests, labels = c("Mean_x", "Mean_y"))
)
# Model 2
m2 = umxRAM("m2", data = g2Data,
umxPath("x", to = "y", labels = "beta"),
umxPath(var = manifests, labels = c("Var_x", "Resid_y_grp2")),
umxPath(means = manifests, labels = c("Mean_x", "Mean_y"))
)
m3 = umxSuperModel('top', m1, m2)
umxGetModel(m3)
umxGetModel(m3, targetModel = "m1")
## End(Not run)
[Package umx version 4.20.0 Index]