Adjust for variables and activate any biasing paths that result
control_for(.tdy_dag, var, as_factor = TRUE, activate_colliders = TRUE, ...)adjust_for(.tdy_dag, var, as_factor = TRUE, activate_colliders = TRUE, ...)
ggdag_adjust(
.tdy_dag,
var = NULL,
...,
node_size = 16,
text_size = 3.88,
label_size = text_size,
text_col = "white",
label_col = text_col,
node = TRUE,
stylized = FALSE,
text = TRUE,
use_labels = NULL,
collider_lines = TRUE
)
a tidy_dagitty
with a adjusted
column for adjusted
variables, as well as any biasing paths that arise, or a ggplot
input graph, an object of class tidy_dagitty
or
dagitty
a character vector, the variable(s) to adjust for.
logical. Should the adjusted
column be a factor?
logical. Include colliders activated by adjustment?
additional arguments passed to tidy_dagitty()
size of DAG node
size of DAG text
size of label text
color of DAG text
color of label text
logical. Should nodes be included in the DAG?
logical. Should DAG nodes be stylized? If so, use
geom_dag_nodes
and if not use geom_dag_point
logical. Should text be included in the DAG?
a string. Variable to use for
geom_dag_label_repel()
. Default is NULL
.
logical. Should the plot show paths activated by adjusting for a collider?
dag <- dagify(m ~ a + b, x ~ a, y ~ b)
control_for(dag, var = "m")
ggdag_adjust(dag, var = "m")
Run the code above in your browser using DataLab