Generate lavaan CFA syntax from an instrument or a declared model
Source:R/model_layer.R
sframe_syntax_cfa.RdThe general entry point for CFA syntax. It takes an instrument, and derives
the constructs from its scales, or an sframe_model_spec() declaring constructs that
cut across them, and it accepts correlated residuals and latent
covariances.
Usage
sframe_syntax_cfa(
instrument = NULL,
model = NULL,
scales = NULL,
ordered = FALSE,
std_lv = TRUE,
residual_covariances = NULL,
latent_covariances = TRUE
)Arguments
- instrument
Optional
sframeobject used to derive constructs from scales whenmodelis not supplied.- model
Optional
sframe_model_spec()object.- scales
Optional scale IDs when deriving a model from an instrument.
- ordered
Logical. Whether to add an ordered-item note.
- std_lv
Logical. Whether to add a
std.lv = TRUEnote.- residual_covariances
Optional list of
sframe_covariance()objects for correlated residuals.- latent_covariances
Logical. Whether to include model-level latent covariances supplied in
model.
Details
Each generator emits the language its engine reads, so they stay separate:
this one and sframe_syntax_sem() write lavaan, sframe_syntax_pls() writes
seminr, and sframe_syntax_efa() writes an exploratory plan.
See also
Other Models and syntax functions:
sframe_add_model(),
sframe_construct(),
sframe_covariance(),
sframe_indirect_effect(),
sframe_model_json(),
sframe_model_outline(),
sframe_model_spec(),
sframe_path(),
sframe_syntax_efa(),
sframe_syntax_pls(),
sframe_syntax_result(),
sframe_syntax_sem(),
sframe_validate_model()
Examples
demo <- sframe_demo("tourism_services")
syntax <- sframe_syntax_cfa(demo$instrument,
scales = c("satisfaction", "behavioural_intention"))
cat(syntax)