R: Structural Equation Modeling and Twin Modeling in R

# Structural Equation Modeling and Twin Modeling in R

## Documentation for package ‘umx’ version 4.65.0

- DESCRIPTION file
- Package NEWS
- Package README

## Help Pages

B D E F G H I L N O P Q R S T U V X

umx-package | Functions for Structural Equation Modeling in OpenMx

## -- B --

bucks | Print a money object

## -- D --

deg2rad | Convert Degrees to Degrees
dl_from_dropbox | dl_from_dropbox
docData | Twin data for Direction of causation modelling

## -- E --

extractAIC.MxModel | Extract AIC from MxModel

## -- F --

fin_CAGR | Calculate Compound Annual Growth Rate (CAGR)
fin_carryCost | Work the carry cost of a house
fin_expected | Compute the future value and gain of an investment
fin_FIF | NZ FIF Tax Offset & NAV Neutrality Calculator
fin_interest | Compute the value of a principal & annual deposits at a compound interest over a number of years
fin_JustifiedPE | Justified P/E Ratio
fin_net_present_value | Compute the net present value of a future income stream
fin_NI | Compute NI given annual Earnings.
fin_option | Teaching function for options
fin_percent | Compute the percent change needed to return to the original value after percent off (or on).
fin_StockCAGR | Compute the CAGR of a stock
fin_ticker | Open a ticker in yahoo finance.
fin_valuation | Work the valuation of a company
Fischbein_wt | Weight data across time.
FishersMethod | Fishers Method of combining p-values.

## -- G --

geometric_mean | Geometric Mean
GFF | Twin data: General Family Functioning, divorce, and well-being.
ggAddR | Add a fit statistic to a ggplot

## -- H --

harmonic_mean | Harmonic Mean

## -- I --

install.OpenMx | Install OpenMx, with choice of builds
iqdat | Twin data: IQ measured longitudinally across 4 ages.

## -- L --

libs | load libraries
loadings | loadings Generic loadings function to extract factor loadings from exploratory or confirmatory factor analyses.
loadings.MxModel | Extract factor loadings from an EFA (factor analysis).

## -- N --

namez | umx_names
noNAs | Succinctly select complete rows from a dataframe

## -- O --

oddsratio | Compute odds ratio (OR)

## -- P --

parameters | Display path estimates from a model, filtering by name and value.
plot | Create and display a graphical path diagram for a model.
plot.MxLISRELModel | Create and display a graphical path diagram for a LISREL model.
plot.MxModel | Create and display a graphical path diagram for a model.
plot.MxModelACE | Make a graphical display of an ACE model
plot.MxModelACEcov | Make a graphical display of an ACE model with covariates.
plot.MxModelACEv | Produce a graphical display of an ACE variance-components twin model
plot.MxModelCP | Draw and display a graphical figure of Common Pathway model
plot.MxModelDoC | Plot a Direction of Causation Model.
plot.MxModelGxE | Plot the results of a GxE univariate test for moderation of ACE components.
plot.MxModelGxEbiv | Plot the results of a GxE univariate test for moderation of ACE components.
plot.MxModelIP | Draw a graphical figure for a Independent Pathway model
plot.MxModelSexLim | Draw and display a graphical figure of a Sex limitation model
plot.MxModelSimplex | Draw and display a graphical figure of a simplex model
plot.MxModelTwinMaker | Create and display a graphical path diagram for a path-based twin model.
plot.percent | Plot a percent change graph
power.ACE.test | Test the power of an ACE model to detect paths of interest.
print | Print a money object
print.oddsratio | Print a scale "oddsratio" object
print.percent | Print a percent object
print.reliability | Print a scale "reliability" object
print.RMSEA | Print a RMSEA object
prolific_anonymize | Clean up a prolific file for sharing by removing anonymity-compromising columns.
prolific_check_ID | Return PIDs in df
prolific_read_demog | Read and optionally merge demographics file from prolific academic

## -- Q --

qm | qm

## -- R --

rad2deg | Convert Radians to Degrees
reliability | Report coefficient alpha (reliability)
residuals.MxModel | Get residuals from an MxModel
RMSEA | Generic RMSEA function
RMSEA.MxModel | RMSEA function for MxModels
RMSEA.summary.mxmodel | RMSEA function for MxModel summary

## -- S --

SE_from_p | Compute an SE from a beta and p value
summaryAPA | Creates nicely formatted journal-style summaries of models, p-values, data-frames and much more.

## -- T --

tmx_genotypic_effect | Graphical display of genotypic effects.
tmx_is.identified | Test if a factor model is identified
tmx_show | Show matrices of models in a easy-to-learn-from format.
tmx_show.MxMatrix | Show matrices of models in a easy-to-learn-from format.
tmx_show.MxModel | Show matrices of RAM models in a easy-to-learn-from format.
tvars | Concatenate base variable names with suffixes to create wide-format variable names (i.e twin-format)

## -- U --

umx | Functions for Structural Equation Modeling in OpenMx
umx-deprecated | Deprecated. May already stop() code and ask to be updated. May be dropped entirely in future.
umx2ord | umx_cont_2_quantiles
umxACE | Build and run a 2-group Cholesky ACE twin model (univariate or multivariate)
umxACEcov | Run a Cholesky with covariates that are random (in the expected covariance matrix)
umxACEv | Build and run 2-group uni- or multi-variate ACE models based on VARIANCE (not paths).
umxAlgebra | A simple wrapper for mxAlgebra with name as the first parameter for more readable compact code.
umxAPA | Creates nicely formatted journal-style summaries of models, p-values, data-frames and much more.
umxBrownie | A recipe Easter-egg for umx
umxCI | Add (and, optionally, run) confidence intervals to a structural model.
umxCI_boot | umxCI_boot
umxCLPM | Runs cross-lagged panel models
umxCompare | Print a comparison table of one or more 'OpenMx::mxModel()'s, formatted nicely.
umxConfint | Get confidence intervals from a umx model
umxCov2cor | Convert a covariance matrix into a correlation matrix
umxCP | umxCP: Build and run a Common Pathway twin model
umxDiagnose | Diagnose problems in a model - not working!
umxDiffMZ | MZ differences method for testing evidence for causality.
umxDiscTwin | Intra-pair association in MZ, DZ twin models. (ALPHA quality!)
umxDoC | Build and run a 2-group Direction of Causation twin models.
umxDoCp | Make a direction of causation model based on umxPath statements
umxEFA | FIML-based Exploratory Factor Analysis (EFA)
umxEquate | umxEquate: Equate two or more paths
umxExampleCode_TRHGpaper | Example code from Twin Research and Human Genetics Paper on umx
umxExamples | Example code from Twin Research and Human Genetics Paper on umx
umxExpCov | Get the expected vcov matrix
umxExpMeans | Extract the expected means matrix from an 'OpenMx::mxModel()'
umxFactanal | FIML-based Exploratory Factor Analysis (EFA)
umxFactor | umxFactor
umxFactorScores | Return factor scores from a model as an easily consumable dataframe.
umxFitIndices | Get additional fit-indices for a model with umxFitIndices
umxFixAll | umxFixAll: Fix all free parameters
umxGetLatents | Get the latentVars from a RAM model
umxGetManifests | Get the manifestVars from a RAM model
umxGetModel | Used to get a RAM submodel by name
umxGetParameters | Get parameters from a model, with support for pattern matching!
umxGxE | umxGxE: Implements ACE models with moderation of paths, e.g. by SES.
umxGxEbiv | Purcell (2002) Bivariate GxE model: Suitable when twins differ on the moderator.
umxGxE_window | Implement the moving-window form of GxE analysis.
umxHetCor | Create a matrix of correlations for variables of diverse types (binary, ordinal, continuous)
umxIP | umxIP: Build and run an Independent Pathway twin model
umxJiggle | umxJiggle
umxLav2RAM | Convert lavaan string to a umxRAM model
umxMatrix | Make a mxMatrix with automatic labels. Also takes name as the first parameter for more readable code.
umxMatrixFree | Sets labeled matrix cells to free
umxMI | Report modifications which would improve fit.
umxModel | Catches users typing umxModel instead of umxRAM.
umxModelNames | Return names of models found within a model
umxModify | umxModify: Add, set, or drop model paths by label.
umxMR | Build a SEM implementing the instrumental variable design
umxMRDoC | Extends Mendelian randomization with the twin design to test evidence of causality
umxParameters | Display path estimates from a model, filtering by name and value.
umxParan | A wrapper to make paran easier to use. Just automates applying 'complete.cases()'
umxPath | Easier (and powerful) specification of paths in SEM.
umxPlot | Quickly plot y ~ x with a regression line and R^2, and nice labels.
umxPlotACE | Make a graphical display of an ACE model
umxPlotACEcov | Make a graphical display of an ACE model with covariates.
umxPlotACEv | Produce a graphical display of an ACE variance-components twin model
umxPlotCP | Draw and display a graphical figure of Common Pathway model
umxPlotDoC | Plot a Direction of Causation Model.
umxPlotFun | Easily plot functions in R
umxPlotGxE | Plot the results of a GxE univariate test for moderation of ACE components.
umxPlotGxEbiv | Plot the results of a GxE univariate test for moderation of ACE components.
umxPlotIP | Draw a graphical figure for a Independent Pathway model
umxPlotMxModelTwinMaker | Create and display a graphical path diagram for a path-based twin model.
umxPlotPredict | 'umxPlotPredict' Take a model and plot the y against predicted(y)
umxPlotSexLim | Draw and display a graphical figure of a Sex limitation model
umxPlotSimplex | Draw and display a graphical figure of a simplex model
umxPower | Test power to detect specified path values in a model.
umxRAM | Build and run path-based SEM models
umxRAM2Lav | Convert a RAM model to a lavaan string
umxReduce | Reduce models, and report the results.
umxReduceACE | Reduce an ACE model.
umxReduceGxE | Reduce a GxE model.
umxRenameMatrix | Rename a umxMatrix (even in a model)
umxRotate | Generic SEM factor model loading rotation function
umxRotate.MxModelCP | Rotate a CP solution
umxRun | umxRun: Run an mxModel
umxSetParameters | Change or fix parameters (e.g. their values, labels, bounds, ..) in a model.
umxSexLim | Multivariate sex limitation twin model
umxSimplex | Build and run a simplex twin model (not ready for use!)
umxSummarizeTwinData | Summarize twin data
umxSummary | Shows a compact, publication-style, summary of umx models
umxSummary.MxModel | Shows a compact, publication-style, summary of a RAM model
umxSummary.MxModelACE | Shows a compact, publication-style, summary of a umx Cholesky ACE model
umxSummary.MxModelACEcov | Present results of a twin ACE-model with covariates in table and graphical forms.
umxSummary.MxModelACEv | Shows a compact, publication-style, summary of a variance-based Cholesky ACE model.
umxSummary.MxModelCP | Present the results of a Common-pathway twin model in table and graphical form
umxSummary.MxModelDoC | Shows a compact, publication-style, summary of a umx Direction of Causation model
umxSummary.MxModelGxE | Summarize a GxE model
umxSummary.MxModelGxEbiv | Summarize a bivariate GxE twin model
umxSummary.MxModelIP | Present the results of an independent-pathway twin model in table and graphical form
umxSummary.MxModelMRDoC | Present the results of a Mendelian Randomization Direction of Causation Model in a table
umxSummary.MxModelSexLim | Shows a compact, publication-style, summary of a umx Sex Limitation model
umxSummary.MxModelSimplex | Shows a compact, publication-style, summary of a Simplex model.
umxSummary.MxRAMModel | Shows a compact, publication-style, summary of a RAM model
umxSummaryACE | Shows a compact, publication-style, summary of a umx Cholesky ACE model
umxSummaryACEcov | Present results of a twin ACE-model with covariates in table and graphical forms.
umxSummaryACEv | Shows a compact, publication-style, summary of a variance-based Cholesky ACE model.
umxSummaryCP | Present the results of a Common-pathway twin model in table and graphical form
umxSummaryDoC | Shows a compact, publication-style, summary of a umx Direction of Causation model
umxSummaryGxE | Summarize a GxE model
umxSummaryGxEbiv | Summarize a bivariate GxE twin model
umxSummaryIP | Present the results of an independent-pathway twin model in table and graphical form
umxSummaryMRDoC | Present the results of a Mendelian Randomization Direction of Causation Model in a table
umxSummarySexLim | Shows a compact, publication-style, summary of a umx Sex Limitation model
umxSummarySimplex | Shows a compact, publication-style, summary of a Simplex model.
umxSuperModel | Make a multi-group model
umxThresholdMatrix | Create the threshold matrix needed for modeling ordinal data.
umxTwinMaker | Make a twin model from the model describing just one person
umxTwoStage | Build a SEM implementing the instrumental variable design
umxUnexplainedCausalNexus | umxUnexplainedCausalNexus
umxVersion | Get or print the version of umx, along with detail from OpenMx and general system info.
umxWeightedAIC | AIC weight-based conditional probabilities.
umx_aggregate | Convenient formula-based cross-tabs & built-in summary functions
umx_APA_pval | Round p-values according to APA guidelines
umx_apply | umx_apply
umx_array_shift | Like the php array_shift function: shifts an item off the beginning of a list
umx_as_numeric | umx_as_numeric
umx_check | umx_check
umx_checkpoint | umx_set_checkpoint
umx_check_model | Check for required features in an OpenMx.
umx_check_names | Check if a request name exists in a dataframe or related object
umx_check_OS | umx_check_OS
umx_check_parallel | Check if OpenMx is using OpenMP, test cores, and get timings
umx_cont_2_quantiles | umx_cont_2_quantiles
umx_cor | Report correlations and their p-values
umx_explode | Explode a string (Like the php function 'explode')
umx_explode_twin_names | Break twin variable names (BMI_T1, BMI_T2) into base variable names (BMI, "_T", 1:2)
umx_factor | umxFactor
umx_file_load_pseudo | Read in files from pseudocons.
umx_find_object | umx_find_object
umx_fun_mean_sd | Summarizing functions used in umx_aggregate and for umxAPA
umx_get_alphas | Get the alpha text
umx_get_bracket_addresses | Get bracket-style addresses from an mxMatrix
umx_get_checkpoint | Get or set checkpointing for a model
umx_get_options | Display umx options
umx_grep | Search for text
umx_has_been_run | umx_has_been_run
umx_has_CIs | umx_has_CIs
umx_has_means | umx_has_means
umx_has_square_brackets | Check if a label contains square brackets
umx_is_class | Check if variables in a dataframe are in a list of classes.
umx_is_cov | umx_is_cov
umx_is_endogenous | List endogenous variables in a model
umx_is_exogenous | umx_is_exogenous
umx_is_MxData | Check if an object is an mxData object
umx_is_MxMatrix | umx_is_MxMatrix
umx_is_MxModel | umx_is_MxModel
umx_is_numeric | Check if variables in a dataframe are numeric
umx_is_ordered | Test if one or more variables in a dataframe are ordered
umx_is_RAM | umx_is_RAM
umx_log_wide_twin_data | Log-transform wide twin data with a positive shift
umx_long2wide | Take a long twin-data file and make it wide (one family per row)
umx_lower.tri | Get values from lower triangle of a matrix
umx_lower2full | Convert lower-only matrix data to full (or enforce symmetry on a full matrix)
umx_make | "make" the umx package using devtools: release to CRAN etc.
umx_make_fake_data | umx_make_fake_data
umx_make_MR_data | Simulate Mendelian Randomization data
umx_make_raw_from_cov | Turn a cov matrix into raw data
umx_make_sql_from_excel | Convert an excel spreadsheet in a text file on sql statements.
umx_make_TwinData | Simulate twin data with control over A, C, and E parameters, as well as moderation of A.
umx_make_twin_data_nice | Convert a twin dataset into umx standard format.
umx_means | umx_means
umx_merge_randomized_columns | umx_merge_randomized_columns
umx_move_file | Move files
umx_msg | Print the name and compact contents of variable.
umx_names | umx_names
umx_open | Open a file or folder
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_polychoric | FIML-based polychoric, polyserial, and Pearson correlations
umx_polypairwise | FIML-based Pairwise polychoric, polyserial, and Pearson correlations
umx_polytriowise | FIML-based trio-based polychoric, polyserial, and Pearson correlations
umx_print | Print tables in a range of formats (markdown default, see 'umx_set_table_format()' for other formats) or as a web browser table.
umx_read_lower | Read lower-triangle of data matrix from console or file
umx_rename | umx_rename
umx_rename_file | Rename files
umx_reorder | Reorder or drop variables from a correlation/covariance matrix.
umx_residualize | Easily residualize variables in long or wide dataframes, returning them changed in-place.
umx_rot | Rotate a vector
umx_round | umx_round
umx_r_test | Test the difference between correlations for significance.
umx_scale | Scale data columns, skipping non-scalable columns
umx_scale_wide_twin_data | Scale wide twin data
umx_score_scale | Score a psychometric scale by summing normal and reversed items.
umx_select_valid | Update NA values in one column with valid entries from another
umx_set_auto_plot | umx_set_auto_plot
umx_set_auto_run | Automatically run models?
umx_set_checkpoint | umx_set_checkpoint
umx_set_condensed_slots | umx_set_condensed_slots
umx_set_cores | umx_set_cores
umx_set_data_variance_check | umx_set_data_variance_check
umx_set_dollar_symbol | Set the symbol for money
umx_set_optimization_options | Set options that affect optimization in OpenMx
umx_set_optimizer | Set the optimizer in OpenMx
umx_set_plot_file_suffix | Set output suffix used in umx SEM diagram files saved to disk.
umx_set_plot_format | Set output format of plots (structural diagrams) in umx
umx_set_separator | Set the separator
umx_set_silent | Turn off most console and summary output from umx
umx_set_table_format | umx_set_table_format
umx_stack | Stack data like stack() does, with more control.
umx_standardize | Return a standardized version of a Structural Model
umx_strings2numeric | A wrapper to map columns of strings to numeric.
umx_string_to_algebra | Convert a string to an OpenMx algebra
umx_str_chars | Select desired characters from a string
umx_str_from_object | Return variable name as a string
umx_time | umx_time
umx_trim | Trim whitespace surrounding a string.
umx_update_OpenMx | Install OpenMx, with choice of builds
umx_var | Get variances from a df that might contain some non-numeric columns
umx_wide2long | umx_wide2long
umx_wide2longTwinData | Change twin data from wide (2 twins per row) to long format.
umx_wide4lmer | Take a long dataframe and make it wide for repeated measures and multi-level analysis
umx_write_to_clipboard | umx_write_to_clipboard
umx_yj_wide_twin_data | Yeo-Johnson transform wide twin data (Non-destructive)
us_skinfold_data | Anthropometric data on twins

## -- V --

vcov.MxModel | Get the expected vcov matrix

## -- X --

xmuHasSquareBrackets | xmuHasSquareBrackets
xmuLabel | xmuLabel: Add labels to a RAM model, matrix, or path
xmuLabel_Matrix | xmuLabel_Matrix (not a user function)
xmuLabel_MATRIX_Model | xmuLabel_MATRIX_Model (not a user function)
xmuLabel_RAM_Model | xmuLabel_RAM_Model (not a user function)
xmuMakeDeviationThresholdsMatrices | Make a deviation-based mxRAMObjective for ordinal models.
xmuMakeOneHeadedPathsFromPathList | xmuMakeOneHeadedPathsFromPathList
xmuMakeTwoHeadedPathsFromPathList | xmuMakeTwoHeadedPathsFromPathList
xmuMaxLevels | xmuMaxLevels
xmuMI | xmuMI (not for end users)
xmuMinLevels | xmuMinLevels
xmuPropagateLabels | xmuPropagateLabels (not a user function)
xmuRAM2Ordinal | xmuRAM2Ordinal
xmuTwinSuper_Continuous | Create core of twin model for all-continuous data.
xmuTwinSuper_NoBinary | xmuTwinSuper_NoBinary
xmuTwinUpgradeMeansToCovariateModel | Not for end-users: Add a means model with covariates to a twin model
xmuValues | xmuValues: Set values in RAM model, matrix, or path
xmu_bracket_address2rclabel | Convert a bracket address into an A_rXcX-style label.
xmu_cell_is_on | Return whether a cell is in a set location of a matrix
xmu_check_levels_identical | xmu_check_levels_identical
xmu_check_needs_means | Check data to see if model needs means.
xmu_check_variance | Check the minimum variance in data frame
xmu_CI_merge | xmu_CI_merge
xmu_CI_stash | Stash the CI values of a model as strings in the values of the model
xmu_clean_label | Remove illegal characters from labels
xmu_data_missing | Drop rows with missing definition variables
xmu_data_swap_a_block | Data helper function to swap blocks of data from one set of columns to another.
xmu_describe_data_WLS | Determine if a dataset will need statistics for the means if used in a WLS model.
xmu_DF_to_mxData_TypeCov | Convert a dataframe into a cov mxData object
xmu_dot_define_shapes | Helper to make the list of vars and their shapes for a graphviz string
xmu_dot_maker | Internal umx function to help plotting graphviz
xmu_dot_make_paths | xmu_dot_make_paths (not for end users)
xmu_dot_make_residuals | xmu_dot_make_residuals (not for end users)
xmu_dot_mat2dot | Return dot code for paths in a matrix
xmu_dot_move_ranks | xmu_dot_move_ranks (not for end users)
xmu_dot_rank | Helper to make a graphviz rank string
xmu_dot_rank_str | xmu_dot_rank_str (not for end users)
xmu_equate_threshold_values | Equate Threshold Values Across Columns in a Model
xmu_extract_column | Get one or more columns from mzData or regular data.frame
xmu_get_CI | Look up and report CIs for free parameters
xmu_lavaan_process_group | Process table of paths to model
xmu_make_bin_cont_pair_data | Make pairs of bin & continuous columns to represent censored data
xmu_make_mxData | Upgrade a dataframe to an mxData type.
xmu_make_TwinSuperModel | Helper to make a basic top, MZ, and DZ model.
xmu_match.arg | Select first item in list of options, while being flexible about choices.
xmu_name_from_lavaan_str | Find name for model
xmu_PadAndPruneForDefVars | Where all data are missing for a twin, add default values for definition variables, allowing the row to be kept
xmu_path2twin | Re-name variables in umxPaths to twin versions
xmu_path_regex | Re-name variables umxPaths to twin versions
xmu_print_algebras | Print algebras from a umx model
xmu_rclabel_2_bracket_address | Convert an "A_r1c1"-style label to a bracket address.
xmu_relevel_factors | Relabel Factor Columns in a Data Frame
xmu_safe_run_summary | Safely run and summarize a model
xmu_set_sep_from_suffix | Just a helper to cope with deprecated suffix lying around.
xmu_show_fit_or_comparison | Show model logLik of model or print comparison table
xmu_simplex_corner | Internal function to help building simplex models
xmu_standardize_ACE | xmu_standardize_ACE
xmu_standardize_ACEcov | xmu_standardize_ACEcov
xmu_standardize_ACEv | Standardize an ACE variance components model (ACEv)
xmu_standardize_CP | Function to standardize a common pathway model
xmu_standardize_IP | non-user: Standardize an IP model
xmu_standardize_RAM | Standardize a Structural Model (not for end users)
xmu_standardize_SexLim | Standardize a SexLim model
xmu_standardize_Simplex | Standardize a Simplex twin model
xmu_starts | Helper providing boilerplate start values for means and variance in twin models
xmu_start_value_list | Make start values
xmu_summary_RAM_group_parameters | Order and group the parameters in a RAM summary
xmu_twin_add_WeightMatrices | Add weight matrices to twin models.
xmu_twin_check | Check basic aspects of input for twin models.
xmu_twin_get_var_names | Not for user: pull variable names from a twin model
xmu_twin_make_def_means_mats_and_alg | Make the matrices and algebras for definition-based means models
xmu_twin_upgrade_selDvs2SelVars | Upgrade selDVs to selVars
xmu_update_covar | Update covariates in twin data sets to 99999 if missing and corresponding twin phenotype to NA