Skip to main content

Enumerate frontdoor adjustment sets

Source: R/identification.R

Description

Lists all sets Z, containing include and contained in restrict, satisfying the front-door criterion; see frontdoor_set() and is_valid_frontdoor().

Usage

all_frontdoor_sets(cg, x, y, include = character(), restrict = NULL)

Arguments

cg A DAG or ADMG created with cgraph(). For an ADMG, see the note on m-separation in frontdoor_set().
x, y Exposure and outcome node name, or character vector of node names.
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(U %-->% X, U %-->% Y, X %-->% Z, Z %-->% Y)
all_frontdoor_sets(dag, "X", "Y", restrict = "Z")
#> [[1]]
#> [1] "Z"