tbates / umx

Making Structural Equation Modeling (SEM) in R quick & powerful
https://tbates.github.io/
44 stars 17 forks source link

Sketch mode for latent variables #168

Closed lf-araujo closed 2 years ago

lf-araujo commented 2 years ago

Sketch mode is very handy while we are exploring theory. However, it seems it does not support sketching models with latent variables. From the help:

Sketch mode

 If you are at the "sketching" stage of theory consideration, ‘umxRAM’
 supports a simple vector of manifest names to work with.

 m1 = umxRAM("sketch", data = c("A", "B", "C"),
         umxPath("A", to = "B"),
         umxPath("B", with = "C"),
         umxPath(v.m. = c("A", "B", "C"))
 )

It would be nice to have something like:

 m1 = umxRAM("sketch", manifests=manifests, latents=latents
         umxPath("A", to = "B"),
         umxPath("B", with = "C"),
         umxPath(v.m. = c("A", "B", "C"))
 )
tbates commented 2 years ago

Hi @lf-araujo This is already supported, so I clarified the help and example:

PS: Sketch is also useful for making data: just set the values you want, and mxGenerateData the data.

m1 = umxRAM("sketch", data = c("A", "B"),
    umxPath("C", to = c("A", "B")),
    umxPath("A", with = "B"),
    umxPath(v.m. = c("A", "B")),
    umxPath(v1m0 = "C")
 )
image