dag.draw {dagR} | R Documentation |
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.
dag.draw(dag, legend = TRUE, paths = TRUE, numbering = FALSE, p = FALSE, alt.symb = TRUE, noxy = 0, ...)
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. |
Returns the DAG (for whatever reason...).
Lutz P Breitling <lutz.breitling@gmail.com>
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.
dag.letter
, garrows
,
smoothArc
, dag.legend
,
write.paths
dag.draw(demo.dag1()); dag.draw(dag.adjust(demo.dag1(), 3), numbering=TRUE, p=TRUE);