Learn R Programming

dagR (version 1.1.1)

dag.draw: Draw a DAG.

Description

Draws a DAG conforming to the dagR format. The nodes are represented by 'C' (covariables; numbered with subscripts) and 'U' (unknown/unmeasured covariables; numbered with subscripts), 'X' and 'Y' (exposure and outcome, respectively). A legend presents the names of the nodes. The X->Y arc is marked with a questionmark as the relationship of interest. Adjusted variables are under- and over-lined. Undirected associations are drawn with dashed lines. If paths have been identified (and evaluated), these (and their status) are written next to the legend.

Usage

dag.draw(dag, legend = TRUE, paths = TRUE, numbering = FALSE,
 p = FALSE, ...)

Arguments

dag
The DAG to be drawn.
legend
Boolean indicating whether a node legend should be included.
paths
Boolean indicating whether paths (and their status) should be written.
numbering
Boolean indicating whether the arcs should be numbered in the DAG.
p
Boolean indicating whether the curving points of undirected associations should be drawn.
...
Currently not used.

Value

  • Returns the DAG (for whatever reason...).

References

Breitling LP (2010). dagR: a suite of R functions for directed acyclic graphs. Epidemiology 21(4):586-587. Greenland S, Pearl J, Robins JM (1999). Causal diagrams for epidemiologic research. Epidemiology 10(1):37-48.

See Also

dag.letter, garrows, smoothArc, dag.legend, write.paths

Examples

Run this code
dag.draw(demo.dag1());
dag.draw(dag.adjust(demo.dag1(), 3), numbering=TRUE, p=TRUE);

Run the code above in your browser using DataLab