Learn R Programming

dagR (version 1.1.1)

dag.adjustment: Adjust a DAG for one or more variables.

Description

Identifies the associations introduced by adjustment for the variables specified, and returns the DAG with these associations added. Note that this is called internally by dag.adjust, which makes sure that biasing paths are looked for and evaluted afterwards. Thus, dag.adjustment should 1.) not be called directly, and 2.) not be called on an already adjusted DAG!

Usage

dag.adjustment(dag, A=NULL)

Arguments

dag
The DAG to be adjusted.
A
The adjustment set to be applied.

Value

  • A DAG with A as the adjustment set and the associations introduced by adjustment for A added to the DAG.

Details

The adjustment set A specified when calling dag.adjustment overrules the adjustment variables that are present in the DAG. To keep these in the adjustment set, one has to add them to A.

See Also

dag.adjust, find.paths, eval.paths

Examples

Run this code
dag1<-demo.dag1();
dag.draw(dag.adjust(dag1, 3));
dag.draw(dag.adjust(dag1, 2));
# problem when adjusting an adjusted DAG:
dag.draw(dag.adjust(dag.adjust(dag1, 3), c(2)));

Run the code above in your browser using DataLab