tbates / umx

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

support operators for umxRAM and plot #153

Open tbates opened 3 years ago

tbates commented 3 years ago

umxRAM and plot

plot

Example (plane-jane regression with interaction)

p1 = lm(mpg~wt*disp, data = mtcars); umxAPA(p1)
(Intercept) B = 44.08 [37.68, 50.48], t = 14.11, p < 0.001
wt B = -6.5 [-9.19, -3.81], t = -4.95, p < 0.001
disp B = -0.06 [-0.08, -0.03], t = -4.26, p < 0.001
wt:disp B = 0.01 [0.01, 0.02], t = 3.6, p = 0.001
productInputs = c("x", "y")
manifests = c(productInputs, "z")
m1 = umxRAM("testPoV", data = povData, productVars = productInputs,
    umxPath(c("x", "y", "xy"), to = "z"),
    umxPath(cov= c("x", "y")),
    umxPath(v.m. = manifests),

   # automatic for the user
   # 1. remove auto-named products from the latents list
   # 2. (add?) fixed@1 paths from productInputs to product 
    umxPath(c("x", "y"), to = "xy", fixedAt = 1),
   # 2 go back into model and fix means productInputs to zero (having checked they are that)
   #   model@matrices$means$free, productInputs], FALSE)
)