Skip to main content

Enumerate backdoor adjustment sets

Source: R/identification.R

Description

Lists all sets (up to size max_size) satisfying the backdoor criterion; see is_valid_backdoor(). When minimal = TRUE (default), only inclusion-minimal sets are returned.

Usage

all_backdoor_sets(
  cg,
  x,
  y,
  minimal = TRUE,
  max_size = 3,
  include = character(),
  restrict = NULL
)

Arguments

cg A DAG or ADMG created with cgraph().
x, y Exposure and outcome node name, or character vector of node names.
minimal If TRUE (default), return only minimal sets.
max_size Maximum adjustment set size to consider.
include Character vector of nodes forced into every set.
restrict Character vector of candidate nodes sets are drawn from. NULL (default) allows every node except x and y.

Value

List of character vectors (empty list if none exist).

Examples

dag <- cgraph(A %-->% X, X %-->% Y, A %-->% Y)
all_backdoor_sets(dag, "X", "Y")
#> [[1]]
#> [1] "A"