dag.draw {dagR}R Documentation

Draw a DAG.

Description

Draws a DAG defined in an object of class dagRdag (as of dagR version 1.2.0, the generic function plot.dagRdag can be used for this purpose, but dag.draw is maintained for backwards compatibility). 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 <l.breitling@posteo.de>

References

Breitling LP (2010). dagR: a suite of R functions for directed acyclic graphs. Epidemiology 21(4):586-587.
Breitling LP, Duan C, Dragomir AD, Luta G (2022). Using dagR to identify minimal sufficient adjustment sets and to simulate data based on directed acyclic graphs. Int J Epidemiol 50(6):1772-1777.
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


[Package dagR version 1.2.1 Index]