Assess if a variable confounds a relationship
is_confounder(.tdy_dag, z, x, y, direct = FALSE)
.tdy_dag | input graph, an object of class |
---|---|
z | a character vector, the potential confounder |
x, y | a character vector, the variables z may confound. |
direct | logical. Only consider direct confounding? Default is
|
Logical. Is the variable a confounder?
#> [1] TRUEis_confounder(dag, "x", "z", "y")#> [1] FALSE