scc_cause_sets: Extracting component causes from SCC model

scc_cause_setsR Documentation

Extracting component causes from SCC model

Description

Extracting component causes by sufficient cause from an epicmodel_scc object.

Usage

scc_cause_sets(
  scc,
  output = c("id", "desc", "desc_no_start", "all"),
  depends = TRUE,
  unknown = FALSE
)

Arguments

scc

An object of class epicmodel_scc.

output

A single element of type character, which determines the type of output. Options are "id", "desc", "desc_no_start", and "all". See returns-part below for description.

depends

TRUE (default) or FALSE. If FALSE, only includes sufficient causes with sc_status "always".

unknown

TRUE or FALSE (default). If TRUE, unknown causes are added to the SCC model: every sufficient cause gets an additional individual unknown component cause representing additional unknown components; an unknown sufficient cause is added to the model consisting of a single unknown component cause and representing all unknown sufficient causes.

Value

A named list but its content depends on parameter "output". The names correspond to the component cause set IDs, i.e., ⁠cc[[:digit:]]+⁠.

  • id: Returns a named list of character vectors. Each vector contains the step IDs of its component causes.

  • desc: Returns a named list of character vectors. Each vector contains the step descriptions of its component causes.

  • desc_no_start: Returns a named list of character vectors. Each vector contains the step descriptions of its component causes, but with the "Start: " in the beginning removed.

  • all: A named list of the three lists above. The names correspond to the corresponding option for parameter "output".

Examples

# Create some SCC model
steplist_checked <- check_steplist(steplist_rain)
scc_model <- create_scc(steplist_checked)

# Get sets of component causes that form the sufficient causes
scc_cause_sets(scc_model, output = "all")

epicmodel documentation built on April 12, 2025, 1:59 a.m.