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. umx contains over 100 functions which build on OpenMx, and are designed to automate activities such as labelling, setting start values etc., and also provides umxRAM and umxPath functions that make Structural Equation Modeling in R straightforward.

Some highlights include:

  1. Building Path Models
    • umxRAM() # mxModel with an R-like 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 and more. Great time-saver!
  2. Reporting output
    • umxSummary(model) # Get a brief summary of model fit, similar to a journal report (Χ², p, CFI, TLI, & RMSEA). Optionally show the path loadings
    • plot(model, std=T, digits = 3, file = "name") # Create a graphical representation of model!
    • umx_time(model) # Report the time taken by a model in a compact programable format
  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 models
    • umxACE() # 1-line function handling twin ACE modeling with aplomb paths are labeled, and works with plot() and umxSummary
    • umxIP(), umxGxE(), umxCP()
  5. Lower level helpers, data helpers, etc.
    • 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.
  6. Helpers for easy-to-forget option names
    • umx_set_cores()
    • umx_set_optimizer()

Dozens more (?umx to see them all). Check out the "family links" in any help file also!

Feel free to use, and improve: Log suggestions using the Github comments. Tell your friends! Get awesome publications :-)

You can install the development version from github:

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.4.0

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Timothy C Bates

Last Published

October 13th, 2016

Functions in umx (1.4.0)

extractAIC.MxModel

extractAIC from MxModel
ex9_6

A multilevel dataset.
logLik.MxModel

logLik.MxModel
install.OpenMx

install.OpenMx
loadings

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

mxSE - Compute standard errors in OpenMx
loadings.MxModel

loadings.MxModel
dl_from_dropbox

dl_from_dropbox
plot.MxModel

Create a graphical figure from an MxModel
confint.MxModel

Get confidence intervals from an MxModel
umx_APA_model_CI

umx_APA_model_CI
umx_add_variances

umx_add_variances
RMSEA

Generic RMSEA function
umx_aggregate

umx_aggregate
reliability

reliability
qm

qm
umx_APA_pval

umx_APA_pval
RMSEA.MxModel

RMSEA function for MxModels
residuals.MxModel

Get residuals from an MxModel
RMSEA.summary.mxmodel

RMSEA function for MxModels
umx_as_numeric

umx_as_numeric
umx_cov_diag

umx_cov_diag
umx_check_model

umx_check_model
umx_check_OS

umx_check_OS
umx_cont_2_quantiles

umx_cont_2_quantiles
umx_check

umx_check
umx_check_names

umx_check_names
umx_cor

umx_cor
umx_apply

umx_apply
umx_check_parallel

umx_check_parallel
umx_explode

umx_explode - like the php function `explode`
umx_default_option

umx_default_option
umx_explode_twin_names

umx_explode_twin_names
umx_cov2raw

Turn a cov matrix into raw data with umx_cov2raw
umx_fun_mean_sd

umx_fun
umx_find_object

umx_find_object
umx_fix_first_loadings

umx_fix_first_loadings
umx_get_bracket_addresses

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

umx_fix_latents
umx_drop_ok

umx_drop_ok
umx_get_cores

umx_get_cores
umx_get_checkpoint

umx_get_checkpoint
umx_is_cov

umx_is_cov
umx_get_optimizer

umx_get_optimizer
umx_has_square_brackets

umx_has_square_brackets
umx_get_options

umx_get_options
umx_has_means

umx_has_means
umx_grep

umx_grep
umx_has_been_run

umx_has_been_run
umx_has_CIs

umx_has_CIs
umx_make_fake_data

umx_make_fake_data
umx_is_endogenous

umx_is_endogenous
umx_make_bin_cont_pair_data

umx_make_bin_cont_pair_data
umx_is_RAM

umx_is_RAM
umx_is_MxMatrix

umx_is_MxMatrix
umx_is_exogenous

umx_is_exogenous
umx_lower2full

umx_lower2full
umx_is_MxModel

umx_is_MxModel
umx_is_ordered

umx_is_ordered
umx_names

umx_names
umx_object_as_str

umx_object_as_str
umx_pad

Pad an Object with NAs
umx_open

umx_open
umx_string_to_algebra

umx_string_to_algebra
umx_swap_a_block

umx_swap_a_block
umx_read_lower

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

umx_print
umx_means

umx_means
umx_round

umx_round
umx_rot

umx_rot
umx_standardize_ACE

umx_standardize_ACE
umx_show

umx_show
umx_make

umx_make umx using devtools
umx_make_TwinData

umx_make_TwinData
umx_set_cores

umx_set_cores
umxACESexLim

umxACESexLim
umx_set_optimizer

umx_set_optimizer
umx_standardize_IP

umx_standardize_IP
umxAdd1

umxAdd1
umxEFA

umxEFA
umx_is_MxData

umx_is_ordered
umx_rename

umx_rename
umx_scale_wide_twin_data

umx_scale_wide_twin_data
umx_scale

umx_scale
umx_time

umx_time
umx_make_MR_data

Simulate Mendelian Randomization data
umx_trim

umx_trim
umx_set_plot_format

umx_set_plot_format
umxCompare

umxCompare
umx_make_sql_from_excel

umx_make_sql_from_excel
umx_set_condensed_slots

umx_set_condensed_slots
umx_paste_names

umx_paste_names
umx_set_checkpoint

umx_set_checkpoint
umxEval

umxEval
umx_standardize_CP

umx_standardize_CP
umx_standardize_RAM

umx_standardize_RAM
umxExpCov

Get the expected vcov matrix
umx_merge_CIs

umx_merge_CIs
umxExpMeans

umxExpMean
umxFactor

umxFactor
umxPath

umxPath: Flexible specification of sem paths
umxPlotACE

umxPlotACE
umxSetParameters

umxSetParameters
xmu_dot_make_paths

xmu_dot_make_paths (not for end users)
umxSummary

umxSummary.default
umxEquate

umxEquate
xmu_dot_make_residuals

xmu_dot_make_residuals (not for end users)
umx-deprecated

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

umx_rename_file
umxCovData

umxCovData
umxLabel

umxLabel
umxCP

umxCP
umxReduce

umxReduce
umxLatent

umxLatent
umxGetParameters

umxGetParameters
umxGxE_window

umxGxE_window
umx_set_table_format

umx_set_table_format
umxRun

umxRun
umx_pb_note

umx_pb_note
umxCov2cor

umxCov2cor
umx_standardize_ACEcov

umx_standardize_ACEcov
umxMatrix

umxMatrix
umxRAM

umxRAM
umxSummary.MxModel

umxSummary.MxModel
umxRAM2Ordinal

umxRAM2Ordinal
umxMI

umxMI
umxSummaryACEcov

umxSummaryACEcov
xmuPropagateLabels

xmuPropagateLabels (not a user function)
umxSummaryACE

umxSummaryACE
umxSummaryCP

umxSummaryCP
xmuLabel_MATRIX_Model

xmuLabel_MATRIX_Model (not a user function)
xmuMakeThresholdsMatrices

xmuMakeThresholdsMatrices (not a user function)
xmuMakeOneHeadedPathsFromPathList

xmuMakeOneHeadedPathsFromPathList
xmuLabel_Matrix

xmuLabel_Matrix (not a user function)
umx

Helper Functions for Structural Equation Modelling in OpenMx
umxPlotACEcov

umxPlotACEcov
umxUnexplainedCausalNexus

umxUnexplainedCausalNexus
umxPlotCP

umxPlotCP
umxValues

umxValues
xmuLabel_RAM_Model

xmuLabel_RAM_Model (not a user function)
xmuMakeDeviationThresholdsMatrices

Make deviation threshold matrics
xmuMakeTwoHeadedPathsFromPathList

xmuMakeTwoHeadedPathsFromPathList
umx_move_file

umx_move_file
umx_msg

umx_msg
umx_reorder

umx_reorder
xmuMaxLevels

xmuMaxLevels
umx_residualize

umx_residualize
umx_set_auto_run

umx_set_auto_run
umx_set_auto_plot

umx_set_auto_plot
umxAPA

umxAPA
umxCF_SexLim

umxCF_SexLim
umxCI

umxCI
umxCI_boot

umxCI_boot
umxGxE

umxGxE
umxIP

umxIP
umxHetCor

umxHetCor
umxJiggle

umxJiggle
umxSummaryIP

umxSummaryIP
umxSummaryGxE

umxSummaryGxE
xmu_start_value_list

Make start values
xmuHasSquareBrackets

xmuHasSquareBrackets
xmuMinLevels

xmuMinLevels
xmuMI

xmuMI
umxDiagnose

mxDiagnostic
umxACEcov

umxACEcov
umxACE

umxACE
umxFitIndices

umxFitIndices
umxFixAll

umxFixAll
umxModify

umxModify
umxDrop1

umxDrop1
umxPadAndPruneForDefVars

umxPadAndPruneForDefVars
umxPlotGxE

umxPlotGxE
umxThresholdMatrix

umxThresholdMatrix
umxTwoStage

umxTwoStage
umxPlotIP

umxPlotIP
xmu_check_levels_identical

xmu_check_levels_identical
us_skinfold_data

Anthropometric data on twins