umx (version 1.9.1)

umx_fix_latents: umx_fix_latents

Description

Fix the variance of all, or selected, exogenous latents at selected values. This function adds a variance to the factor if it does not exist.

Usage

umx_fix_latents(model, latents = NULL, exogenous.only = TRUE, at = 1)

Arguments

model

an mxModel to set

latents

(If NULL then all latentVars)

exogenous.only

only touch exogenous latents (default = TRUE)

at

(Default = 1)

Value

- mxModel

References

- http://tbates.github.io, https://github.com/tbates/umx, http://openmx.ssri.psu.edu

See Also

Other Advanced Model Building Functions: umxJiggle, umxLabel, umxRAM2Ordinal, umxThresholdMatrix, umxValues, umx_fix_first_loadings, umx

Examples

Run this code
# NOT RUN {
require(umx)
data(demoOneFactor)
m1 <- mxModel("One Factor", type = "RAM",
 manifestVars = names(demoOneFactor),
 latentVars = "g",
	mxPath(from = "g", to = names(demoOneFactor)),
	mxPath(from = names(demoOneFactor), arrows = 2),
	mxData(cov(demoOneFactor), type = "cov", numObs = 500)
)
umx_show(m1, matrices = "S") # variance of g is not set
m1 = umx_fix_latents(m1)
umx_show(m1, matrices = "S") # variance of g is fixed at 1
# }

Run the code above in your browser using DataLab