Learn R Programming

umx (version 1.4.0)

umxLatent: umxLatent

Description

Helper to ease the creation of latent variables including formative and reflective variables (see below) For formative variables, the manifests define (form) the latent. This function takes care of intercorrelating manifests for formatives, and fixing variances correctly

Usage

umxLatent(latent = NULL, formedBy = NULL, forms = NULL, data = NULL, type = NULL, name = NULL, labelSuffix = "", verbose = TRUE, endogenous = "deprecated")

Arguments

latent
the name of the latent variable (string)
formedBy
the list of variables forming this latent
forms
the list of variables which this latent forms (leave blank for formedBy)
data
the dataframe being used in this model
type
= \"exogenous|endogenous\"
name
A name for the path NULL
labelSuffix
a suffix string to append to each label
verbose
Default is TRUE as this function does quite a lot
endogenous
This is now deprecated. use type= \"exogenous|endogenous\"

Value

- path list

Details

The following figures show how a reflective and a formative variable look as path diagrams: reflective.png formativeformative.png

References

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

See Also

Other Model Building Functions: umxDiagnose, umxLabel, umxMatrix, umxModify, umxPath, umxRAM2Ordinal, umxRAM, umxRun, umxThresholdMatrix, umxValues, umx_fix_first_loadings, umx_fix_latents, umx

Examples

Run this code
## Not run: 
# library(umx)
# data(demoOneFactor)
# latents = c("G")
# manifests = names(demoOneFactor) # x1-5
# theData = cov(demoOneFactor)
# m1 = mxModel("reflective", type = "RAM",
# manifestVars = manifests,
# latentVars   = latents,
# # Factor loadings
# umxLatent("G", forms = manifests, type = "exogenous", data = theData),
# mxData(theData, type = "cov", numObs = nrow(demoOneFactor))
# )
# m1 = umxRun(m1, setValues = TRUE, setLabels = TRUE); umxSummary(m1, show="std")
# plot(m1)
# 
# m2 = mxModel("formative", type = "RAM",
# manifestVars = manifests,
# latentVars   = latents,
# # Factor loadings
# umxLatent("G", formedBy = manifests, data = theData),
# mxData(theData, type = "cov", numObs = nrow(demoOneFactor))
# )
# m2 = umxRun(m2, setValues = TRUE, setLabels = TRUE);
# umxSummary(m2, show = "std")
# plot(m2)
# ## End(Not run)

Run the code above in your browser using DataLab