umxLISREL: Make a LISREL model analogous to umxRAM

View source: R/umxLISREL.R

umxLISRELR Documentation

Make a LISREL model analogous to umxRAM

Description

umxLISREL is a wrapper for OpenMx::mxModel() with type="LISREL". It automatically partitions manifest and latent variables into endogenous and exogenous sets, inserts data, handles raw/covariance types, adds means if raw data are used, handles ordinal variables, runs the model, and displays summaries.

Usage

umxLISREL(
  model = NA,
  ...,
  data = NULL,
  manifestVars = NULL,
  latentVars = NULL,
  name = NA,
  group = NULL,
  group.equal = NULL,
  suffix = "",
  comparison = TRUE,
  type = c("Auto", "FIML", "cov", "cor", "WLS", "DWLS", "ULS"),
  weight = NULL,
  allContinuousMethod = c("cumulants", "marginals"),
  autoRun = getOption("umx_auto_run"),
  tryHard = c("no", "yes", "ordinal", "search"),
  std = FALSE,
  refModels = NULL,
  remove_unused_manifests = TRUE,
  independent = NA,
  setValues = TRUE,
  optimizer = NULL,
  verbose = FALSE,
  std.lv = FALSE,
  printTab = FALSE
)

Arguments

model

NA, a name string, or an existing LISREL OpenMx::mxModel() to update.

...

Path statements (mxPath or umxPath), matrices, etc., to add to the model.

data

Data frame, matrix, or mxData to use.

manifestVars

Optional list of endogenous/exogenous manifest variables, or character vector of manifest variables to partition.

latentVars

Optional list of endogenous/exogenous latent variables, or character vector of latent variables to partition.

name

Optional name for the model (defaults to the model's current name or 'm1').

group

Column name in data to partition data for multi-group models.

group.equal

Not implemented.

suffix

Suffix to append to parameter labels.

comparison

Compare the model to saturated models in summary (Default = TRUE).

type

Data type: "Auto" (guesses), "FIML", "cov", "cor", "WLS", "DWLS", "ULS".

weight

Weight column name.

allContinuousMethod

Method for continuous variables when WLS is used.

autoRun

Run the model (default = TRUE).

tryHard

How to run the model: "no", "yes", "ordinal", "search".

std

Standardize output (Default = FALSE).

refModels

Reference models for summary comparison.

remove_unused_manifests

Remove manifests not used in paths (Default = TRUE).

independent

Whether the model is independent (Default = NA).

setValues

Automatically set starting values (Default = TRUE).

optimizer

Set the optimizer to use.

verbose

Print diagnostic info.

std.lv

Standardize latent variables (Default = FALSE).

printTab

Print parameter table.

Value

A LISREL OpenMx::mxModel()

References

https://github.com/tbates/umx, https://tbates.github.io

See Also

umxRAM(), plot.MxLISRELModel(), xmu_standardize_LISREL()

Other Core Model Building Functions: umx, umxMatrix(), umxModify(), umxPath(), umxRAM(), umxRAM_DE(), umxSuperModel()

Examples

## Not run: 
library(umx)
data(demoOneFactor)
manifests = names(demoOneFactor)

# 1. LISREL model with covariance data
m1 = umxLISREL("one_factor_cov", data = demoOneFactor, type = "cov",
	umxPath("G", to = manifests),
	umxPath(var = manifests),
	umxPath(var = "G", fixedAt = 1)
)

# 2. LISREL model with raw data (means are automatically added)
m2 = umxLISREL("one_factor_raw", data = demoOneFactor,
               umxPath("G", to = manifests),
               umxPath(var = manifests),
               umxPath(var = "G", fixedAt = 1))

# 3. Forced exogenous manifests using manifestVars list override
m3 = umxLISREL("forced_exogenous", data = demoOneFactor,
               manifestVars = list(endogenous = c("x4", "x5"), exogenous = c("x1", "x2")),
               latentVars = list(endogenous = "G", exogenous = "xi"),
               umxPath("xi", to = c("x1", "x2")),
               umxPath("G", to = c("x4", "x5")),
               umxPath("xi", to = "G"),
               umxPath(var = c("x1", "x2", "x4", "x5")),
               umxPath(var = "xi", fixedAt = 1),
               umxPath(var = "G"),
               umxPath(means = c("x1", "x2", "x4", "x5")))

## End(Not run)

umx documentation built on Oct. 11, 2026, 5:07 p.m.