Checks model IDs, construct IDs, indicators, structural path endpoints, duplicate paths, indirect paths, and engine/type compatibility.
Arguments
- model
An
sframe_model_spec()object or compatible list.- instrument
Optional
sframeobject. When supplied, model indicators must match instrument item IDs.- strict
Logical. When
TRUE, invalid models raise an error. WhenFALSE, problems are reported in the returned diagnostic without stopping.
Value
An sframe_validation object. The model is carried inside it and
can be recovered with sframe_object().
Changed in 0.4.0
Earlier versions returned the model invisibly when strict = TRUE and a
bare unclassed list when strict = FALSE. Both paths now return an
sframe_validation object, visibly, so the diagnostic is readable at the
console. Code that read $valid and $problems keeps working.
See also
sframe_validation, sframe_problems(), sframe_is_valid()
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_cfa(),
sframe_syntax_efa(),
sframe_syntax_pls(),
sframe_syntax_result(),
sframe_syntax_sem()
Examples
demo <- sframe_demo("tourism_services")
m <- sframe_model_spec(
"cb1", type = "cb_sem",
constructs = list(
sframe_construct("sq", items = c("sq_1", "sq_2", "sq_3")),
sframe_construct("sat", items = c("sat_1", "sat_2"))
),
paths = list(sframe_path("sq", "sat"))
)
diag <- sframe_validate_model(m, instrument = demo$instrument)
diag