Skip to contents

Create a surveyframe model specification

Usage

sframe_model_spec(
  id,
  label = NULL,
  type = c("efa", "cfa", "cb_sem", "pls_sem"),
  engine = NULL,
  constructs = list(),
  paths = list(),
  covariances = list(),
  indirect = list(),
  options = list()
)

Arguments

id

Model identifier.

label

Human-readable model label.

type

Model type. One of "efa", "cfa", "cb_sem", or "pls_sem".

engine

Optional engine name. Defaults to "lavaan" for CFA/CB-SEM and "seminr" for PLS-SEM.

constructs

List of sframe_construct() objects.

paths

List of sframe_path() objects.

covariances

List of sframe_covariance() objects.

indirect

List of sframe_indirect_effect() objects.

options

List of model options, such as estimator, missing, bootstrap, or standardised.

Value

An object of class sf_model.

Examples

m <- sframe_model_spec(
  "cb1", "Quality drives intention", type = "cb_sem",
  constructs = list(
    sframe_construct("sq", "Service Quality", items = c("sq_1", "sq_2", "sq_3")),
    sframe_construct("sat", "Satisfaction", items = c("sat_1", "sat_2")),
    sframe_construct("bi", "Behavioural Intention", items = c("bi_1", "bi_2"))
  ),
  paths = list(sframe_path("sq", "sat"), sframe_path("sat", "bi")),
  indirect = list(sframe_indirect_effect("sq", through = "sat", to = "bi"))
)
m$type
m$engine