prevent {epicmodel}R Documentation

Explore effect of prevention

Description

Prevention refers to the avoidance of component causes, i.e., of elements of sufficient causes. For a given set of component causes, prevent() derives, which of them need to be "removed" in order to avoid outcome occurrence. Reported are the smallest prevention sets, i.e., with the fewest component causes.

Usage

prevent(scc, causes = NULL, output = c("nice", "table"))

Arguments

scc

An object of class epicmodel_scc.

causes

A character vector containing step IDs of component causes. If NULL (default), prints a list of all available component causes in the console.

output

Either "nice" (default) or "table". If "nice", prints a nicely formatted summary in the console. If "table", returns a data.frame (described in section "Value" below).

Details

The following algorithm is used to evaluate the effect of prevention:

Value

If output = "nice" (default), prints a nicely formatted output in the console. If output = "table", returns a data.frame with one row for every prevention set and one column for every component cause provided in argument causes. All cells are either TRUE or FALSE with TRUE indicating that the corresponding variable needs to be prevented in the corresponding set, and FALSE indicating that prevention in the corresponding set is not necessary.

Examples

# Derive SCC model
scc_model <- scc_rain

# Derive prevention sets
prevent(scc_model, causes = c("IFNOTd6a6THENd5a6","THENa5","THENa1","THENd2a3"))

[Package epicmodel version 0.2.0 Index]