Skip to contents

A lower-level alternative to run_fastsem() that returns the raw fastsem result list without injecting estimates back into the model object. Useful for inspecting fit statistics or parameter tables before committing to the OpenMx model representation, or when you do not need the full inject-back machinery.

Usage

umx_to_fastsem(model, data = NULL, ...)

Arguments

model

An MxModel object (from umxRAM() etc.).

data

Data frame of observed data. Defaults to model@data@observed when NULL.

...

Reserved for future use.

Value

Named list as returned by fastsem_fit(), with an additional $lavaan_syntax element containing the translated lavaan syntax string for inspection.

See also

run_fastsem() for the full inject-back workflow; fastsem_fit() for fitting from raw lavaan syntax.

Examples

if (FALSE) { # \dontrun{
library(umx)
df <- as.data.frame(scale(mtcars[, c("mpg","hp","wt")]))

m <- umxRAM("path",
  umxPath(from = c("hp","wt"), to = "mpg"),
  umxPath(cov   = c("hp","wt")),
  umxPath(var   = c("hp","wt","mpg")),
  umxPath(means = c("hp","wt","mpg")),
  data = df, autoRun = FALSE
)
res <- umx_to_fastsem(m)
cat("lavaan syntax used:\n", res$lavaan_syntax, "\n")
cat("chi2 =", res$chi2, "  df =", res$df, "\n")
} # }