if (FALSE) {
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)
}
Run the code above in your browser using DataLab