umx (version 1.9.1)

umx: Helper Functions for Structural Equation Modelling in OpenMx

Description

umx allows you to more easily build, run, modify, and report models using OpenMx with code. The core functions are linked below under See Also

Arguments

Details

The functions are organized into families: Have a read of these below, click to explore.

All the functions have explanatory examples, so use the help, even if you think it won't help :-) Have a look, for example at umxRAM

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 http://tbates.github.io

If you want the bleeding-edge version:

devtools::install_github("tbates/umx")

References

- http://www.github.com/tbates/umx

See Also

Other Core Modelling Functions: plot.MxModel, umxDiagnose, umxLatent, umxMatrix, umxPath, umxRAM, umxReduceACE, umxReduceGxE, umxRun, umxSuperModel

Other Super-easy helpers: umxEFA, umxTwoStage

Other Reporting Functions: loadings.MxModel, tmx_is.identified, umxAPA, umxFactorScores, umxGetParameters, umxReduce, umxSummary, umx_APA_pval, umx_aggregate, umx_parameters, umx_print, umx_show, umx_time

Other Twin Modeling Functions: plot.MxModel, umxACESexLim, umxACE_cov_fixed, umxACEcov, umxACEv, umxACE, umxCF_SexLim, umxCP, umxGxE_window, umxGxE, umxIP, umxPlotACEcov, umxPlotCP, umxPlotGxE, umxPlotIP, umxReduceACE, umxSummaryACEcov, umxSummaryACEv, umxSummaryACE, umxSummaryCP, umxSummaryGxE, umxSummaryIP, umx_long2wide, umx_wide2long, xmu_twin_check

Other Modify or Compare Models: umxAdd1, umxDrop1, umxEquate, umxFixAll, umxMI, umxSetParameters, umxUnexplainedCausalNexus

Other Advanced Model Building Functions: umxJiggle, umxLabel, umxRAM2Ordinal, umxThresholdMatrix, umxValues, umx_fix_first_loadings, umx_fix_latents

Other Misc: umxEval, umx_APA_model_CI, umx_add_variances, umx_apply, umx_default_option, umx_get_bracket_addresses, umx_object_as_str, umx_string_to_algebra

Other Data Functions: umxCovData, umxFactor, umxHetCor, umxPadAndPruneForDefVars, umx_as_numeric, umx_cont_2_quantiles, umx_cov2raw, umx_long2wide, umx_lower2full, umx_make_MR_data, umx_make_TwinData, umx_make_bin_cont_pair_data, umx_make_fake_data, umx_merge_CIs, umx_read_lower, umx_reorder, umx_residualize, umx_round, umx_scale_wide_twin_data, umx_scale, umx_swap_a_block, umx_wide2long

Other Utility Functions: qm, umx_find_object, umx_msg, umx_names, umx_paste_names, umx_pb_note, umx_print, umx_rename

Other Stats Functions: reliability, umxCov2cor, umx_cor, umx_means

Other File Functions: dl_from_dropbox, umx_make_sql_from_excel, umx_move_file, umx_open, umx_rename_file

Other zAdvanced Helpers: umx_standardize_ACEcov, umx_standardize_ACEv, umx_standardize_ACE, umx_standardize_CP, umx_standardize_IP

Examples

Run this code
# NOT RUN {
require("umx")
data(demoOneFactor)
myData = mxData(cov(demoOneFactor), type = "cov", numObs = nrow(demoOneFactor))
latents = c("G")
manifests = names(demoOneFactor)
m1 <- umxRAM("One Factor", data = myData,
	umxPath(latents, to = manifests),
	umxPath(var = manifests),
	umxPath(var = latents  , fixedAt=1)
)

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

# Let's get some journal-ready fit information

umxSummary(m1) 
umxSummary(m1, show = "std") #also display parameter estimates 
# You can get the coefficients of an MxModel with coef(), just like for lm etc.
coef(m1)

# ==================
# = Model updating =
# ==================
# Can we set the loading of X5 on G to zero?
m2 = omxSetParameters(m1, labels = "G_to_x1", values = 0, free = FALSE, name = "no_g_on_X5")
m2 = mxRun(m2)
# Compare the two models
umxCompare(m1, m2)

# Use umxModify to do the same thing in 1-line
m2 = umxModify(m1, "G_to_x1", name = "no_effect_of_g_on_X5", comparison = TRUE)

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

# umxSummary() will show these, but you can also use the confint() function
confint(m1) # OpenMx's SE-based confidence intervals
umxConfint(m1, parm = 'all', run = TRUE) # likelihood-based CIs

# And make a Figure in dot (.gv) format!
plot(m1, std = TRUE)

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

Run the code above in your browser using DataLab