umx: Functions for Structural Equation Modeling in OpenMx

umxR Documentation

Functions for Structural Equation Modeling in OpenMx

Description

umx allows you to more easily build, run, modify, and report structural models, building on the OpenMx package. All core functions are organized into families, so they are easier to find (so if you know a function similar to what you are looking for, look at other members of its "family" at the bottom of its help file.

Please cite as: Bates, T. C., Neale, M. C., & Maes, H. H. (2019). umx: A library for Structural Equation and Twin Modelling in R. Twin Research and Human Genetics, 22, 27-41. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1017/thg.2019.2")}.

All the functions have full-featured and well commented examples, some even have figures, so use the help, even if you think it won't help :-) Have a look, for example at umxRAM()

Check out NEWS about new features at news(package = "umx")

Details

Introductory working examples are below. You can run all demos with demo(umx) When I have a vignette, it will be: vignette("umx", package = "umx")

There is a helpful blog at https://tbates.github.io

(Only) if you want the bleeding-edge version:

devtools::install_github("tbates/umx")

Author(s)

Maintainer: Timothy C. Bates timothy.c.bates@gmail.com (ORCID)

Other contributors:

References

  • Bates, T. C., Neale, M. C., & Maes, H. H. (2019). umx: A library for Structural Equation and Twin Modelling in R. Twin Research and Human Genetics, 22, 27-41. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1017/thg.2019.2")}, https://github.com/tbates/umx, tutorial: https://tbates.github.io

See Also

Useful links:

Other Core Model Building Functions: umxMatrix(), umxModify(), umxPath(), umxRAM(), umxSuperModel()

Other Model Summary and Comparison: umxCompare(), umxEquate(), umxMI(), umxReduce(), umxSetParameters(), umxSummary()

Other Reporting Functions: umxAPA(), umxFactorScores(), umxGetLatents(), umxGetManifests(), umxGetModel(), umxGetParameters(), umxParameters(), umx_aggregate(), umx_time()

Other Super-easy helpers: umxEFA(), umxTwoStage()

Other Twin Modeling Functions: power.ACE.test(), umxACE(), umxACEcov(), umxACEv(), umxCP(), umxDiffMZ(), umxDiscTwin(), umxDoC(), umxDoCp(), umxGxE(), umxGxE_window(), umxGxEbiv(), umxIP(), umxMRDoC(), umxReduce(), umxReduceACE(), umxReduceGxE(), umxRotate.MxModelCP(), umxSexLim(), umxSimplex(), umxSummarizeTwinData(), umxSummaryACE(), umxSummaryACEv(), umxSummaryDoC(), umxSummaryGxEbiv(), umxSummarySexLim(), umxSummarySimplex(), umxTwinMaker()

Other Twin Data functions: umx_long2wide(), umx_make_TwinData(), umx_make_twin_data_nice(), umx_residualize(), umx_scale_wide_twin_data(), umx_wide2long()

Other Miscellaneous Stats Functions: FishersMethod(), SE_from_p(), geometric_mean(), harmonic_mean(), oddsratio(), reliability(), umxCov2cor(), umxHetCor(), umxParan(), umxWeightedAIC(), umx_apply(), umx_cor(), umx_means(), umx_r_test(), umx_round(), umx_scale(), umx_var()

Other Teaching and testing Functions: tmx_genotypic_effect(), tmx_is.identified()

Other Get and set: umx_get_checkpoint(), umx_get_options(), umx_set_auto_plot(), umx_set_auto_run(), umx_set_checkpoint(), umx_set_condensed_slots(), umx_set_cores(), umx_set_data_variance_check(), umx_set_dollar_symbol(), umx_set_optimization_options(), umx_set_optimizer(), umx_set_plot_file_suffix(), umx_set_plot_format(), umx_set_plot_use_hrbrthemes(), umx_set_separator(), umx_set_silent(), umx_set_table_format()

Other Check or test: umx_check_names(), umx_is_class(), umx_is_endogenous(), umx_is_exogenous(), umx_is_numeric(), umx_is_ordered()

Other Plotting functions: ggAddR(), plot.MxLISRELModel(), plot.MxModel(), plot.MxModelTwinMaker(), umxPlot(), umxPlotACE(), umxPlotACEcov(), umxPlotACEv(), umxPlotCP(), umxPlotDoC(), umxPlotFun(), umxPlotGxE(), umxPlotGxEbiv(), umxPlotIP(), umxPlotSexLim(), umxPlotSimplex()

Other Data Functions: noNAs(), prolific_anonymize(), prolific_check_ID(), prolific_read_demog(), umxFactor(), umxHetCor(), umx_as_numeric(), umx_cont_2_quantiles(), umx_lower2full(), umx_make_MR_data(), umx_make_TwinData(), umx_make_fake_data(), umx_make_raw_from_cov(), umx_merge_randomized_columns(), umx_polychoric(), umx_polypairwise(), umx_polytriowise(), umx_read_lower(), umx_rename(), umx_reorder(), umx_score_scale(), umx_select_valid(), umx_stack(), umx_strings2numeric()

Other File Functions: dl_from_dropbox(), umx_file_load_pseudo(), umx_make_sql_from_excel(), umx_move_file(), umx_open(), umx_rename_file(), umx_write_to_clipboard()

Other String Functions: umx_explode(), umx_explode_twin_names(), umx_grep(), umx_names(), umx_paste_names(), umx_rot(), umx_str_chars(), umx_str_from_object(), umx_trim()

Other Miscellaneous Utility Functions: install.OpenMx(), libs(), qm(), umxLav2RAM(), umxModelNames(), umxRAM2Lav(), umxVersion(), umx_array_shift(), umx_find_object(), umx_lower.tri(), umx_msg(), umx_open_CRAN_page(), umx_pad(), umx_print()

Other datasets: Fischbein_wt, GFF, docData, iqdat, us_skinfold_data

Other Advanced Model Building Functions: umxAlgebra(), umxFixAll(), umxJiggle(), umxRun(), umxThresholdMatrix(), umxUnexplainedCausalNexus(), xmuLabel(), xmuValues()

Examples

## Not run: 
require("umx")
data(demoOneFactor)
manifests = names(demoOneFactor)
m1 = umxRAM("One Factor", data = demoOneFactor, type="cov",
	umxPath("G", to = manifests),
	umxPath(var = manifests),
	umxPath(var = "G"  , fixedAt= 1)
)

# umx added informative labels, created starting values, 
# Ran your model (if autoRun is on), and displayed a brief summary
# including a comparison if you modified a model...!

# umxSummary generates journal-ready fit information.
# We can choose std=T for standardized parameters and can also
# filter out some types of parameter (e.g. means or residuals)

umxSummary(m1, std = TRUE, residuals=FALSE)

# parameters() flexibly retrieves model coefficients. 
# For example just G-loadings greater than |.3| and rounded to 2-digits.
parameters(m1, thresh="above", b=.3, pattern = "G_to.*", digits = 2)

# (The built-in coef works as for lm etc.)
coef(m1)

# ==================
# = Model updating =
# ==================
# umxModify modifies, renames, re-runs, and compares a model
# Can we set the loading of x1 on G to zero? (nope...)
m2 = umxModify(m1, "G_to_x1", name = "no_effect_of_g_on_X1", comparison = TRUE)

# note1: umxSetParameters can do this with some additional flexibility
# note2 "comparison = TRUE" above is the same as calling 
# umxCompare, like this
umxCompare(m1, m2)


# ========================
# = Confidence intervals =
# ========================

# umxSummary() will show these, but you can also use the confint() function
confint(m1) # OpenMx's SE-based confidence intervals


# umxConfint formats everything you need nicely, and allows adding CIs (with parm=)
umxConfint(m1, parm = 'all', run = TRUE) # likelihood-based CIs

# And make a Figure and open in browser
plot(m1, std = TRUE)

# If you just want the .dot code returned set file = NA
plot(m1, std = TRUE, file = NA)

## End(Not run)


tbates/umx documentation built on Dec. 14, 2024, 11:28 a.m.