umx stands for "user" mx function, and is a library of helper functions for doing Structural Equation Modeling in OpenMx.
You can install the most recent version from github as follows
install.packages("devtools")
library("devtools")
install_github("umx", username = "tbates")
library("umx")
?umx
# on windows you might need
# install_github("umx", username = "tbates", args = "--no-multiarch")
# On the newest version of devtools, this will work
# install_github("tbates/umx")The umx package has a range of useful helpers to help you get things done in SEM. This list is not comprehensive: install the package to learn more
- Building Models
umxStart()# Add sane start values to a model: very helpfulumxLabel()# Add labels to paths: Labels allow you to set, equate, and drop paths by label!umxLatent()# Helper for building formative and reflective latent variables from their manifest indicators
- Run models
umxRun()# Use in place of mxRun to: set labels, starts, compute saturated for raw data, run model until it returns greenumxReRun()# Modify a model (drop paths etc), run, and even return the comparison all in 1 line
- Reporting output
umxSummary(model)# Get a brief summary of model fit, similar to a journal report (Χ², p, CFI, TLI, & RMSEA)umxPlot(fit1, std=T, precision=3, dotFilename="name")# Create a graphical representation of a RAM model (outputs a GraphViz file)umxTime(fit1)# Report the time taken by a model in a compact friendly, programable format
- Modify models
umxMI()# Report the top n modification indicesumxAdd1()# add parameters and return a table of the effect on fitumxDrop1()# Drop parameters and return a table of the effect on fitumxGetParameters(model, regex = "as_r_2c_[0-9]", free = T)# A powerful assistant to get labels from a model. likeomxGetParametersbut uses regular expressions.umxReRun()# re-run a model: Quickly drop or free parameters, rename the model, and re-run...
- Data and package helpers
umxHcor(data, use = "pairwise.complete.obs")# Compute appropriate pair-wise correlations for mixed data types.umx_lower2full(lower.no.diag, diag=F, byrow=F)# Create a full matrix from a lower matrix of dataumxUpdateOpenMx(bleedingEdge = FALSE, loadNew = TRUE)# Update the OpenMx packageumxSaturated(model)*# Create a saturated model when raw data are being used. *summary(model, SaturatedLikelihood = model_sat$Sat, IndependenceLikelihood = model_sat$Ind)- nb:* Saturated solutions are not computable for definition variables and some other models.
Feel free to use, and improve: Log suggestions here using the Github comments, wiki, or git.
- Tim Bates
- Michael Culbertson (modification index code (based on functions in John Fox's SEM package))
- Ryne Estabrook (code to Standardize RAM models)