Nothing
## ----setup, include = FALSE---------------------------------------------------
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.width = 6,
fig.height = 5
)
library(umx)
library(OpenMx)
umx_set_auto_plot(FALSE)
## ----data-setup---------------------------------------------------------------
data("HS.ability.data", package = "OpenMx")
manifests = c("visual", "cubes", "flags", "paragrap", "sentence", "wordm",
"addition", "counting", "straight")
# Scale for stable optimization (recommended for this dataset in umx)
df = umx_scale(HS.ability.data)
## ----one-factor, results = "hide", message = FALSE----------------------------
m1 = umxRAM("Holzinger_1f", data = df,
umxPath("g", to = manifests),
umxPath(v.m. = manifests),
umxPath(v1m0 = "g")
)
## ----one-factor-summary, message = FALSE--------------------------------------
umxSummary(m1, refModels = FALSE)
## ----one-factor-mi, message = FALSE-------------------------------------------
umxMI(m1)
## ----three-factor, results = "hide", message = FALSE--------------------------
model3f = "
spatial =~ visual + cubes + flags
verbal =~ paragrap + sentence + wordm
speed =~ addition + counting + straight
"
m3 = umxRAM(model3f, data = df, name = "Holzinger_3f")
## ----three-factor-summary, message = FALSE------------------------------------
umxSummary(m3, refModels = FALSE)
## ----three-factor-compare, message = FALSE------------------------------------
umxCompare(m3, m1)
## ----bifactor-multigroup-demo, eval = FALSE-----------------------------------
# # Bifactor + umxMI, or multi-group one-factor by sex
# modelBifactor = "
# g =~ visual + cubes + flags + paragrap + sentence + wordm + addition + counting + straight
# spatial =~ visual + cubes + flags
# verbal =~ paragrap + sentence + wordm
# speed =~ addition + counting + straight
# spatial ~~ 0*verbal + 0*speed + 0*g
# verbal ~~ 0*speed + 0*g
# speed ~~ 0*g
# "
# mBio = umxRAM(modelBifactor, data = df, name = "Holzinger_bifactor")
# umxMI(mBio)
#
# mMG = umxRAM("Holzinger_1f_MG", data = df, group = "Gender",
# umxPath("g", to = manifests),
# umxPath(v.m. = manifests),
# umxPath(v1m0 = "g")
# )
# umxMI(mMG)
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.