sc_contain_steps: Do steps appear in sufficient causes?

sc_contain_stepsR Documentation

Do steps appear in sufficient causes?

Description

Extracts from a SCC model, if certain steps are part of the mechanism of sufficient causes. If you want a list of all steps, ignore argument steps.

Usage

sc_contain_steps(scc, steps = NULL, output = c("nice", "table"))

Arguments

scc

An object of class epicmodel_scc.

steps

A character vector containing step IDs. IF NULL (default), provides a list of all steps.

output

A single element of type character, either "nice" (default) or "table". If "table", returns a list (or data.frame if steps = NULL). If "nice", a nicely formated output is printed in the console.

Value

Either a list (output = "table") with length equal to the number of sufficient causes and each element being a named vector of TRUE/FALSE with the variables in steps as names and TRUE indicating that the step appears in the corresponding sufficient cause, or a nicely formated output in the console (output = "nice"). If steps = NULL and output = "table", returns a data.frame, which contains variables id_step and desc_step from the epicmodel_steplist_checked data.frame step.

Examples

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

# Check if one or more steps are part of the mechanism for each sufficient cause
sc_contain_steps(scc_model, c("THENa1","THENa5"))

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