ewc_syntax: Generate ESEM-within-CFA Lavaan Syntax

View source: R/ewc.R

ewc_syntaxR Documentation

Generate ESEM-within-CFA Lavaan Syntax

Description

Converts a fitted ESEM solution into explicit lavaan CFA syntax following the ESEM-within-CFA approach (Marsh et al. 2014). The syntax uses unstandardised ESEM loadings as starting values (start(v)*item) or fixed values (v*item) depending on the referent scheme.

Usage

ewc_syntax(esem_fit, spec, referents = NULL, var_fixed = TRUE)

Arguments

esem_fit

An esem_fit object from run_comparison (results$fit_esem) or esem / esem_ordered.

spec

An esem_spec from specify_model.

referents

Named character vector of referent items, one per factor. Names = factor names; values = item names. If NULL (default), referents are selected automatically via find_ewc_referents.

var_fixed

Logical. Identification mode:

TRUE (default)

Factor variances fixed to 1 (std.lv = TRUE). Only referent cross-loadings on other factors are fixed. Mirrors Mplus EX\@1; MD\@1; CI\@1;.

FALSE

Factor variances freely estimated. Referent's own primary loading is also fixed for identification. Mirrors Mplus EX*; MD*; CI*;.

For a B-ESEM source the same two schemes apply to G and to every specific factor; all factor covariances stay fixed at zero in both.

Value

A character string of lavaan model syntax. Use cat() to inspect, or pass directly to fit_ewc via custom_syntax.

References

Marsh, H. W., Morin, A. J. S., Parker, P. D., & Kaur, G. (2014). Exploratory structural equation modeling. Annual Review of Clinical Psychology, 10, 85-110.

See Also

find_ewc_referents, fit_ewc


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