powered by
Assess if a variable confounds a relationship
is_confounder(.tdy_dag, z, x, y, direct = FALSE)
Logical. Is the variable a confounder?
input graph, an object of class tidy_dagitty or dagitty
tidy_dagitty
dagitty
a character vector, the potential confounder
a character vector, the variables z may confound.
logical. Only consider direct confounding? Default is FALSE
FALSE
dag <- dagify(y ~ z, x ~ z) is_confounder(dag, "z", "x", "y") is_confounder(dag, "x", "z", "y")
Run the code above in your browser using DataLab