Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

OpenMx

OpenMx: An package for Structural Equation Modeling and Matrix Algebra Optimization


Description

OpenMx is a package for structural equation modeling, matrix algebra optimization and other statistical estimation problems. Try the example below. We try and have useful help files: for instance help(mxRun) to learn more. Also the reference manual

Details

OpenMx solves algebra optimization and statistical estimation problems using matrix algebra. Most users use it for Structural equation modeling.

The core function is mxModel, which makes a model. Models are containers for mxData, matrices, mxPaths algebras, mxBounds, confidence intervals, and mxConstraints. Most models require an expectation (see the list below) to calculate the expectations for the model. Models also need a fit function, several of which are built-in (see below). OpenMx also allows user-defined fit functions for purposes not covered by the built-in functions. (e.g., mxFitFunctionR or mxFitFunctionAlgebra).

Note, for mxModels of type="RAM", the expectation and fit-function are set for you automatically.

Running and summarizing a model

Once built, the resulting mxModel can be run (i.e., optimized) using mxRun. This returns the fitted model.

You can summarize the results of the model using summary(yourModel)

Additional overview of model making and getting started

The OpenMx manual is online (see references below). However, mxRun, mxModel, mxMatrix all have working examples that will help get you started as well.

The main OpenMx functions are: mxAlgebra, mxBounds, mxCI, mxConstraint, mxData, mxMatrix, mxModel, and mxPath.

Datasets built into OpenMx

OpenMx comes with over a dozen useful datasets built-in. Discover them using data(package="OpenMx"), and open them with, for example, data("jointdata", package ="OpenMx", verbose= TRUE)

Please cite the 'OpenMx' package in any publications that make use of it:

Michael C. Neale, Michael D. Hunter, Joshua N. Pritikin, Mahsa Zahery, Timothy R. Brick Robert M. Kirkpatrick, Ryne Estabrook, Timothy C. Bates, Hermine H. Maes, Steven M. Boker. (2016). OpenMx 2.0: Extended structural equation and statistical modeling. Psychometrika, 81, 535–549. DOI: 10.1007/s11336-014-9435-8

Steven M. Boker, Michael C. Neale, Hermine H. Maes, Michael J. Wilde, Michael Spiegel, Timothy R. Brick, Jeffrey Spies, Ryne Estabrook, Sarah Kenny, Timothy C. Bates, Paras Mehta, and John Fox. (2011) OpenMx: An Open Source Extended Structural Equation Modeling Framework. Psychometrika, 306-317. DOI:10.1007/s11336-010-9200-6

Steven M. Boker, Michael C. Neale, Hermine H. Maes, Michael J. Wilde, Michael Spiegel, Timothy R. Brick, Ryne Estabrook, Timothy C. Bates, Paras Mehta, Timo von Oertzen, Ross J. Gore, Michael D. Hunter, Daniel C. Hackett, Julian Karch, Andreas M. Brandmaier, Joshua N. Pritikin, Mahsa Zahery, Robert M. Kirkpatrick, Yang Wang, and Charles Driver. (2016) OpenMx 2 User Guide. http://openmx.ssri.psu.edu/docs/OpenMx/latest/OpenMxUserGuide.pdf

References

The OpenMx User's guide can be found at https://openmx.ssri.psu.edu/documentation

Examples

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 the MxModel =
# ====================
m1 <- mxModel("One Factor", type = "RAM", 
	manifestVars = manifests, latentVars = latents, 
	mxPath(from = latents, to = manifests),
	mxPath(from = manifests, arrows = 2),
	mxPath(from = latents, arrows = 2, free = FALSE, values = 1.0),
	mxData(cov(demoOneFactor), type = "cov", numObs = 500)
)

# ===============================
# = mxRun it and get a summary! =
# ===============================

m1 = mxRun(m1)
summary(m1)

OpenMx

Extended Structural Equation Modelling

v2.19.5
Apache License (== 2.0)
Authors
Steven M. Boker [aut], Michael C. Neale [aut], Hermine H. Maes [aut], Michael J. Wilde [ctb], Michael Spiegel [aut], Timothy R. Brick [aut], Ryne Estabrook [aut], Timothy C. Bates [aut], Paras Mehta [ctb], Timo von Oertzen [ctb], Ross J. Gore [aut], Michael D. Hunter [aut], Daniel C. Hackett [ctb], Julian Karch [ctb], Andreas M. Brandmaier [ctb], Joshua N. Pritikin [aut, cre], Mahsa Zahery [aut], Robert M. Kirkpatrick [aut], Yang Wang [ctb], Ben Goodrich [ctb], Charles Driver [ctb], Massachusetts Institute of Technology [cph], S. G. Johnson [cph], Association for Computing Machinery [cph], Dieter Kraft [cph], Stefan Wilhelm [cph], Sarah Medland [cph], Carl F. Falk [cph], Matt Keller [cph], Manjunath B G [cph], The Regents of the University of California [cph], Lester Ingber [cph], Wong Shao Voon [cph], Juan Palacios [cph], Jiang Yang [cph], Gael Guennebaud [cph], Jitse Niesen [cph]
Initial release
2021-03-26

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.