Preview DAG


Preview LaTeX


Edit LaTeX

Use this tab to manually edit the TikZ generated by shinyDAG.

Note that changes made to the TikZ code below will not affect the DAG settings in the app. Changes made to the DAG elsewhere in shinyDAG will overwrite any changes made to the manually edited TikZ code below.


Classic Confounding

This depicts classic confounding, where a confounder C is a common cause of exposure (E) and outcome (Y).

Differential Loss to Follow-Up

This depicts differential loss to follow up, where patients may be censored (C) depending on their value of L.

Mediator with Confounding

This shows a mediator with confounding, where the variable M mediates the effect of E on Y, which is confounded by the variable C.

Selection Bias

This depicts classic selection bias, where C denotes criteria under which the data are observed which, in turn, is a downstream consequence of exposure (E) and outcome (D).

About shinyDAG

Development Team

For more information about our lab and other projects please check out our website at

All code and detailed instructions for usage is available on GitHub at GerkeLab/shinyDag

If you have any questions or comments, we would love to hear them. You can email us at or Or feel free to open an issue in our GitHub repository.