tbates / umx

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

refModels = FALSE does not skip the reference models run #200

Closed lf-araujo closed 2 years ago

lf-araujo commented 2 years ago

It's my understanding from the manual that setting the switch refModels = FALSE in umxRAM would skip reference models part, however it does not seem to work:

umx 4.10.50

library(umx)
m2 = umxRAM("big and heavy", data = mtcars, refModels = FALSE,
    # One headed paths from disp and weight to mpg
    umxPath(c("disp", "wt"), to = "mpg"),
    # Allow predictors to Covary
    umxPath("disp", with = "wt"),
    # free variances and means for each manifest
    umxPath(v.m. = c("disp", "wt", "mpg"))
)
tbates commented 2 years ago

Thanks for trying this feature – fixed now!

refModels wasn't being passed through the chain from 'umxRAM' to xmu_safe_run_summary to umxSummary.MxModel

library(umx)
mtcars$litres = mtcars$disp/61.2
m1 = umxRAM("auto refs", tryHard="yes", data = mtcars,
    umxPath(v.m. = c("litres", "wt", "mpg")),
    umxPath("litres", to = "mpg"),
    umxPath("litres", with = "wt")
)
m2 = umxRAM("no refs", refModels = FALSE, tryHard="yes", data = mtcars,
    umxPath(v.m. = c("litres", "wt", "mpg")),
    umxPath("litres", to = "mpg"),
    umxPath("litres", with = "wt")
)
plot(m2, std = T, means = FALSE)
image
tbates commented 2 years ago

@lf-araujo