Instrumental Variables | R Documentation |
node_instrumental
tags instrumental variables given an exposure and
outcome. ggdag_instrumental
plots all instrumental variables. See
dagitty::instrumentalVariables()
for details.
node_instrumental(.dag, exposure = NULL, outcome = NULL, ...)
ggdag_instrumental(
.tdy_dag,
exposure = NULL,
outcome = 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
)
.dag , .tdy_dag |
input graph, an object of class |
exposure |
character vector of length 1, name of exposure variable.
Default is |
outcome |
character vector of length 1, name of exposure variable.
Default is |
... |
additional arguments passed to |
node_size |
size of DAG node |
text_size |
size of DAG text |
label_size |
size of label text |
text_col |
color of DAG text |
label_col |
color of label text |
node |
logical. Should nodes be included in the DAG? |
stylized |
logical. Should DAG nodes be stylized? If so, use
|
text |
logical. Should text be included in the DAG? |
use_labels |
a string. Variable to use for |
a tidy_dagitty
with an instrumental
column for
instrumental variables or a ggplot
library(dagitty)
node_instrumental(dagitty("dag{ i->x->y; x<->y }"), "x", "y")
ggdag_instrumental(dagitty("dag{ i->x->y; i2->x->y; x<->y }"), "x", "y")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.