Learn R Programming

⚠️There's a newer version (4.20.0) of this package.Take me there.

umx

umx is a structural equation modelling package designed to make SEM easier to build, modify, and report.

It includes high-level functions for complex models such as multi-group twin models, as well as for graphical model output.

Grab it from CRAN with

install.packages("umx")
library(umx)
?umx

The best way to learn what is on offer is to use the help ('?umx' works) and the online tutorial: tbates.github.io

umx stands for "user" OpenMx functions. It provides over 100 functions from high-level umxRAM and umxPath functions that make Structural Equation Modeling in R straightforward, to low-level functions to automate activities such as labelling, setting start values etc.,

Some highlights include:

  1. Building Path Models
    • umxRAM() # mxModel with smart data = parameter, no need to specify type = "RAM", + auto-discovery of manifests and latents from the paths you write
    • umxPath() # mxPath on steroids: one-word settings to set var , mean cov, fixedAt 'v.m.' = and more. Great time-saver!
  2. Reporting output
    • umxSummary(model) # A model fit designed for journal reporting (Χ², p, CFI, TLI, & RMSEA). Optionally show the path loadings
    • plot(model, std=T, digits = 3, file = "name") # Graphical, editable output of model in your browser!
  3. Modify models
    • umxModify() *# Modify and run a model. You can add objects, drop or add paths, including by regular-expression label matching), re-name the model, re-run, and even return the comparison. All in 1 line *
    • umxGetParameters(model, regex = "as_r_2c_[0-9]", free = T) # A powerful assistant to get labels from a model. like omxGetParameters but uses regular expressions.
  4. Twin modeling!
    • umxACE() # Twin ACE modeling with aplomb paths are labeled! Works with plot() and umxSummary!
    • umxCP(), umxIP(), umxGxE(), umxCP()
  5. Easy-to-remember options
    • umx_set_cores()
    • umx_set_optimizer()
  6. Many more miscellaneous helpers e.g.
    • umx_time(model) # Report the time taken by a model in a compact programable format
    • umxStart() # Add plausible start values to RAM or matrix models, or matrices: very helpful
    • umxLabel() # Add systematic labels to paths ("var1_to_var2") and matrix cells ("a_r1c1"). This is great for setting, equating and dropping paths by label!
    • umxHcor(data, use = "pairwise.complete.obs") # Compute appropriate pair-wise correlations for mixed data types.
    • Dozens more (?umx to see them all). Check out the "family links" in any help file also!

Feel free to use, and submit code and requests via Github. Tell your friends! Publish more good science :-)

For thrill-seekers and collaborators only: the bleeding-edge development version is here:

install.packages("devtools")
library("devtools")
install_github("tbates/umx")
library("umx")
?umx

Copy Link

Version

Install

install.packages('umx')

Monthly Downloads

1,824

Version

1.7.5

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Timothy C Bates

Last Published

April 7th, 2017

Functions in umx (1.7.5)

extractAIC.MxModel

extractAIC from MxModel
install.OpenMx

Easily install the latest parallel/NPSOL enabled build of OpenMx.
residuals.MxModel

Get residuals from an MxModel
umx-deprecated

Deprecated. May already stop() code and ask to be updated. May be dropped entirely in future.
umxCovData

umxCovData
umxDiagnose

mxDiagnostic
umxEquate

umxEquate: Equate two or more paths
umxEval

umxEval
umxHetCor

umxHetCor
umxIP

umxIP: Build and run an Independent pathway twin model
umxRAM

Easy-to-use RAM model maker.
umxRAM2Ordinal

umxRAM2Ordinal
umxSummaryACEcov

umxSummaryACEcov
umxSummaryCP

umxSummaryCP
umxThresholdMatrix

umxThresholdMatrix: Helper makes a complete threshold matrix needed in ordinal models.
umxTwoStage

umxTwoStage
umx_cov2raw

Turn a cov matrix into raw data with umx_cov2raw
umx_default_option

umx_default_option
umx_fun_mean_sd

umx_fun
umx_get_bracket_addresses

get mat[r,c] style cell address from an mxMatrix
umx_has_square_brackets

umx_has_square_brackets
umx_is_MxData

Check if an object is an mxData object
umx_is_ordered

Test if one or more variables in a dataframe are ordered
umx_lower2full

umx_lower2full
umx_names

umx_names
umx_object_as_str

umx_object_as_str
umx_pb_note

umx_pb_note
umx_print

umx_print
umx_set_auto_plot

umx_set_auto_plot
umx_set_auto_run

umx_set_auto_run
umx_standardize_ACEcov

umx_standardize_ACEcov
umx_standardize_CP

umx_standardize_CP
umx_var

Get variances from a df that might contain some non-numeric columns
umx_write_to_clipboard

umx_write_to_clipboard
dl_from_dropbox

dl_from_dropbox
ex9_6

A multilevel dataset.
umxACESexLim

umxACESexLim: Build and run a sex-limitaiton twin model (not working yet)
umxACEcov

umxACEcov: Build and run a Cholesky with covariates in the covariance
umxCompare

umxCompare
umxCov2cor

umxCov2cor
umxDrop1

umxDrop1: Unfinished function to mimic drop1 in OpenMx
umxEFA

umxEFA
umxMatrix

umxMatrix: labeled mxMatrix, with name in the first place
umxModel

Catches users typing umxModel instead of umxRAM
umxPlotACEcov

umxPlotACEcov
umxPlotCP

umxPlotCP
umxSetParameters

umxSetParameters: Set parameters in an mxModel
umxSummary.MxModel

Shows a compact, publication-style, summary of a RAM model
umx_APA_pval

umx_APA_pval
umx_add_variances

umx_add_variances
umx_check_names

umx_check_names
umx_check_parallel

umx_check_parallel
umx_drop_ok

umx_drop_ok
umx_explode

umx_explode - like the php function `explode`
umx_is_MxMatrix

umx_is_MxMatrix
umx_is_MxModel

umx_is_MxModel
umx_make_TwinData

Simulate twin data with control over A, C, E, and moderation
umx_make_bin_cont_pair_data

umx_make_bin_cont_pair_data
umx_make_fake_data

umx_make_fake_data
umx_make_sql_from_excel

umx_make_sql_from_excel
umx_rename

umx_rename
umx_rename_file

umx_rename_file
umx_rot

umx_rot
umx_round

umx_round
umx_standardize_IP

umx_standardize_IP
umx_standardize_RAM

umx_standardize_RAM
xmuLabel_MATRIX_Model

xmuLabel_MATRIX_Model (not a user function)
xmuMakeThresholdsMatrices

xmuMakeThresholdsMatrices (not a user function)
xmuLabel_Matrix

xmuLabel_Matrix (not a user function)
xmuMakeTwoHeadedPathsFromPathList

xmuMakeTwoHeadedPathsFromPathList
RMSEA.MxModel

RMSEA function for MxModels
RMSEA

Generic RMSEA function
qm

qm
reliability

reliability
umxAPA

umxAPA
umxAdd1

umxAdd1
umxFactor

umxFactor
umxFitIndices

umxFitIndices
umxGxE

umxGxE: Implements ACE models with moderation of paths, e.g. by SES.
umxGxE_window

umxGxE_window
umxPlotGxE

umxPlotGxE
umxPlotIP

umxPlotIP
umxReduce

umxReduce
umxRun

umxRun: Run an mxModel
umxVersion

Print the version of umx, along with detail from OpenMx and general system info.
umx_APA_model_CI

umx_APA_model_CI
umx_check_OS

umx_check_OS
umx_check_model

umx_check_model
umx_fix_first_loadings

umx_fix_first_loadings
umx_fix_latents

umx_fix_latents
umx_has_been_run

umx_has_been_run
umx_has_means

umx_has_means
umx_make

umx_make umx using devtools
umx_make_MR_data

Simulate Mendelian Randomization data
umx_open

umx_open
umx_open_CRAN_page

Open the CRAN page for a package
umx_pad

Pad an Object with NAs
umx_paste_names

Concatenate base variable names with suffixes to create wide-format variable names (i.e twin-format)
umx_set_cores

umx_set_cores
umx_set_optimizer

umx_set_optimizer
umx_set_plot_format

umx_set_plot_format
umx_set_table_format

umx_set_table_format
umx_time

umx_time
umx_trim

umx_trim
xmuMakeDeviationThresholdsMatrices

Make deviation threshold matrics
xmuMakeOneHeadedPathsFromPathList

xmuMakeOneHeadedPathsFromPathList
loadings.MxModel

loadings.MxModel
loadings

loadings Generic loadings function to extract factor loadings from exploratory or confirmatory factor analyses.
logLik.MxModel

logLik.MxModel
plot.MxModel

Create a graphical figure from an MxModel
umxCI_boot

umxCI_boot
umxCP

umxCP: Build and run a Common pathway twin model
umxExpCov

Get the expected vcov matrix
umxExpMeans

umxExpMean
umxLatent

umxLatent: Helper to ease making formative and reflective latent variables
umxMI

umxMI
umxPath

umxPath: Easier (but powerful) specification of RAM paths.
umxPlotACE

umxPlotACE
umxCF_SexLim

umxCF_SexLim
umxCI

umxCI
umxSummary

umxSummary.default
umxSummaryACE

umxSummaryACE
umx_aggregate

umx_aggregate
umx_apply

umx_apply
umxSummaryGxE

umxSummaryGxE
umxSummaryIP

umxSummaryIP
umx_as_numeric

umx_as_numeric
umx_scale

umx_scale
umx_scale_wide_twin_data

umx_scale_wide_twin_data
us_skinfold_data

Anthropometric data on twins
xmuHasSquareBrackets

xmuHasSquareBrackets
RMSEA.summary.mxmodel

RMSEA function for MxModels
umx_check

umx_check
umx_get_checkpoint

umx_get_checkpoint
umx_get_cores

umx_get_cores
umx_grep

umx_grep
umx_has_CIs

umx_has_CIs
umx_is_RAM

umx_is_RAM
umx_is_cov

umx_is_cov
umx_move_file

umx_move_file
confint.MxModel

Get confidence intervals from an MxModel
umx

Helper Functions for Structural Equation Modelling in OpenMx
umxACE

umxACE: Build and run a 2-group Cholesky (uni- or multi-variate)
umx_msg

umx_msg
umx_reorder

umx_reorder
umx_residualize

umx_residualize
umx_set_checkpoint

umx_set_checkpoint
umx_set_condensed_slots

umx_set_condensed_slots
umx_string_to_algebra

umx_string_to_algebra
umx_swap_a_block

umx_swap_a_block
umxFixAll

umxFixAll: Fix all free parameters
umxGetParameters

umxGetParameters: Get parameters from a model
umxJiggle

umxJiggle
umxLabel

umxLabel: Add labels to a RAM model, matrix, or path
umxModify

umxModify: Add, set, or drop model paths by label.
umxPadAndPruneForDefVars

umxPadAndPruneForDefVars
xmuMaxLevels

xmuMaxLevels
xmuMinLevels

xmuMinLevels
xmu_start_value_list

Make start values
umxUnexplainedCausalNexus

umxUnexplainedCausalNexus
umxValues

umxValues: Set values in RAM model, matrix, or path
umx_cont_2_quantiles

umx_cont_2_quantiles
umx_cor

umx_cor
umx_explode_twin_names

umx_explode_twin_names
umx_find_object

umx_find_object
umx_get_optimizer

umx_get_optimizer
umx_get_options

umx_get_options
umx_is_endogenous

umx_is_endogenous
umx_is_exogenous

umx_is_exogenous
umx_means

umx_means
umx_merge_CIs

umx_merge_CIs
umx_r_test

umx_r_test
umx_read_lower

Read lower-triangle of data matrix from console or file
umx_show

umx_show
umx_standardize_ACE

umx_standardize_ACE
xmuLabel_RAM_Model

xmuLabel_RAM_Model (not a user function)
xmuMI

xmuMI
xmuPropagateLabels

xmuPropagateLabels (not a user function)
xmu_check_levels_identical

xmu_check_levels_identical
xmu_dot_make_paths

xmu_dot_make_paths (not for end users)
xmu_dot_make_residuals

xmu_dot_make_residuals (not for end users)