prune_dag {theorytools} | R Documentation |
Prune DAG Based on Adjustment Sets
Description
Wraps adjustmentSets to construct a pruned DAG which only includes covariates that (asymptotically) allow unbiased estimation of the causal effects of interest.
Usage
prune_dag(
x,
exposure = NULL,
outcome = NULL,
which_set = c("first", "sample", "all"),
...
)
Arguments
x |
An input graph of class |
exposure |
Atomic character, name of the exposure variable. |
outcome |
Atomic character, name of the outcome variable. |
which_set |
Atomic character, indicating which set of covariates to
select in case there are multiple. Valid choices are in
|
... |
Other arguments passed to adjustmentSets |
Value
If which_set = "all"
, returns a list of data.frames
to allow for
sensitivity analyses. Otherwise, returns a data.frame
.
See Also
Examples
dag <- dagitty::dagitty('dag {x -> y}')
prune_dag(dag, exposure = "x", outcome = "y")
[Package theorytools version 0.1.2 Index]