Learn R Programming

OpenMx (version 2.7.9)

mxSE: Compute standard errors in OpenMx

Description

This function allows you to obtain standard errors for arbitrary expressions, named entities, and algebras.

Usage

mxSE(x, model, details = FALSE, ...)

Arguments

x
the parameter to get SEs on (reference or expression)
model
the mxModel to use.
details
logical. Whether to provide further details, e.g. the full sampling covariance matrix of x.
...
further named arguments passed to mxEval

Value

SE value(s) returned as a matrix when details is FALSE. When details is TRUE, a list of the SE value(s) and the full sampling covariance matrix.

Details

x can be the name of an algebra, a bracket address, named entity or arbitrary expression. It is a frontend-only file that works much like mxEval. When the details argument is TRUE, the full sampling covariance matrix of x is also returned as part of a list. The square root of the diagonals of this sampling covariance matrix are the standard errors.

References

- https://en.wikipedia.org/wiki/Standard_error

See Also

- mxCI

Examples

Run this code
library(OpenMx)
data(demoOneFactor)
# ===============================
# = Make and run a 1-factor CFA =
# ===============================

latents  = c("G") # the latent factor
manifests = names(demoOneFactor) # manifest variables to be modeled
# ===========================
# = Make and run the model! =
# ===========================
m1 <- mxModel("One Factor", type = "RAM", 
	manifestVars = manifests, latentVars = latents, 
	mxPath(from = latents, to = manifests, labels=paste0('lambda', 1:5)),
	mxPath(from = manifests, arrows = 2),
	mxPath(from = latents, arrows = 2, free = FALSE, values = 1),
	mxData(cov(demoOneFactor), type = "cov", numObs = 500)
)
m1 = mxRun(m1)
mxSE(lambda5, model = m1)
mxSE(lambda1^2, model = m1)

Run the code above in your browser using DataLab