Skip to main content

Find every possible causal effect in a PAG (PAGcauses)

Source: R/identification.R, R/jlbind-wrappers.R

Description

Returns every valid adjustment set relative to (x, y) in some MAG consistent with the PAG cg, i.e. the possible causal effects of x on y identifiable via covariate adjustment. It does so without enumerating MAGs (PAGcauses, Algorithm 1).

Usage

pagcauses(cg, x, y)

Arguments

cg A PAG created with cgraph().
x, y Exposure and outcome node names.

Details

If x is not a possible ancestor of y, returns an empty list (no causal effect). If the causal effect is already identifiable directly in cg (backdoor_set()), returns that single set. Otherwise, this searches every valid local structure at x (possible_local_structures()) and its maximal local MAG (maximal_local_mag()) for potential adjustment sets.

Assumes cg has no selection bias (no undirected edges).

Value

List of character vectors (empty list if x has no possible causal effect on y).

References

Wang T, Tao L, Qin T, Zhou Z (2025). “Estimating possible causal effects with latent variables via adjustment and novel rule orientation.” Artificial Intelligence, 347, 104387.

Examples

pag <- cgraph(
  X %o->% Y, X %o->% C, X %o->% A, Y %o-o% C, C %o-o% A,
  B %o->% C, B %o->% Y, B %o->% A,
  class = "PAG"
)
pagcauses(pag, "X", "Y")
#> [[1]]
#> character(0)
#> 
#> [[2]]
#> [1] "A" "B"
#> 
#> [[3]]
#> [1] "C"
#> 
#> [[4]]
#> [1] "B" "C"
#> 
#> [[5]]
#> [1] "A" "B" "C"