Skip to contents

Model fitting for free factor variance ESEM

Usage

fit_free_factor_var_esem(model_syntax, data, ...)

Arguments

model_syntax

An ESEM model fitting create with syntax_composer() and only_fix_crossloadings = FALSE.

data

Data.frame where rows are observations and columns are indicators. Alternatively, a covariance matrix. If a covariance matrix, sample.nobs must be included in ...

...

Other name = value pairs to lavaan::lavaan().

Value

A lavaan object with the fitted model.

Details

Lavaan's lavaan::cfa() function automatically fixes the first indicator of factors when factor (residual) variances are set as free parameters with std.lv = TRUE. The present function is a wrapper around lavaan::lavaan() with the same parameters as the cfa function, except that factor variances are set free and no additional fixing is done. This allows the correct estimation of ESEM-within-CFA models with free factor variances, granted that the model syntax was made with syntax_composer() with only_fix_crossloadings = FALSE and thus includes the correct number of fixed parameters. See the esem-as-efa vignette for an example.