umxGetLatents | R Documentation |
Get the latentVars from a RAM model, optionally targeting a submodel.
umxGetLatents(model, targetModel = NULL)
model |
a |
targetModel |
name of the model to extract from |
variables
umxGetManifests()
, umxRAM()
, umxSuperModel()
Other Reporting Functions:
umx
,
umxAPA()
,
umxFactorScores()
,
umxGetManifests()
,
umxGetModel()
,
umxGetParameters()
,
umxParameters()
,
umx_aggregate()
,
umx_time()
## 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)
umxGetLatents(m3)
umxGetLatents(m3, targetModel = "m1")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.