dag.draw {dagR}R Documentation

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, alt.symb = TRUE, noxy = 0, ...)

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.

alt.symb

Boolean indicating if the alternative node symbols (dag$symbols) should be used. Note that especially the legends and paths will not be formatted nicely if these symbols are longer strings.

noxy

Integer to indicate if the X->Y should not be drawn (0=default; 1=no arc; 2=arc, but no question mark).

...

Currently not used.

Value

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

Author(s)

Lutz P Breitling <lutz.breitling@gmail.com>

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

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

[Package dagR version 1.1.3 Index]