fit_ewc: Fit an ESEM-within-CFA Model

View source: R/ewc.R

fit_ewcR Documentation

Fit an ESEM-within-CFA Model

Description

Generates EWC lavaan syntax from a fitted ESEM solution and estimates it as a standard lavaan::cfa() model – no rotation required.

Usage

fit_ewc(
  esem_fit,
  spec,
  referents = NULL,
  var_fixed = TRUE,
  missing = NULL,
  custom_syntax = NULL,
  ...
)

Arguments

esem_fit

An esem_fit object (results$fit_esem).

spec

An esem_spec from specify_model.

referents

Named character vector of referent items or NULL (auto-selected). See find_ewc_referents.

var_fixed

Logical. Identification mode. Default TRUE (factor variances = 1). See ewc_syntax for details.

missing

Character. Missing data handling. Defaults to "pairwise" for ordered, "listwise" for continuous.

custom_syntax

Character or NULL. Supply a hand-edited syntax string (from ewc_syntax) instead of auto-generating. When non-NULL, referents and var_fixed still control the lavaan::cfa() options (std.lv).

...

Additional arguments forwarded to lavaan::cfa().

Value

An object of class "ewc_fit":

lavaan_fit

lavaan fit object; all lavaan generics work on it.

syntax

lavaan model string used.

referents

Named vector of referent items.

var_fixed

Identification mode used.

estimator

Estimator ("MLR" for continuous, "DWLS" for ordered).

spec

The spec object.

See Also

ewc_syntax, find_ewc_referents, compare_ewc


bifactory documentation built on Oct. 28, 2026, 1:06 a.m.