is_confounder: Assess if a variable confounds a relationship

View source: R/adjustment_sets.R

is_confounderR Documentation

Assess if a variable confounds a relationship

Description

Assess if a variable confounds a relationship

Usage

is_confounder(.tdy_dag, z, x, y, direct = FALSE)

Arguments

.tdy_dag

input graph, an object of class tidy_dagitty or dagitty

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 FALSE

Value

Logical. Is the variable a confounder?

Examples

dag <- dagify(y ~ z, x ~ z)

is_confounder(dag, "z", "x", "y")
is_confounder(dag, "x", "z", "y")


ggdag documentation built on Sept. 11, 2024, 6:12 p.m.