Giter Site home page Giter Site logo

waternk / shinydag Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gerkelab/shinydag

0.0 1.0 0.0 52.8 MB

a Shiny app to create/visualize/analyze causal diagrams (DAGs)

Home Page: https://www.gerkelab.com/project/shinydag/

License: MIT License

R 88.03% Dockerfile 4.42% CSS 5.02% JavaScript 2.53%

shinydag's Introduction

shinyDAG

shinyDAG is a web application that uses R and LaTeX to create publication-quality images of directed acyclic graphs (DAGs). Additionally, the application leverages complementary R packages to evaluate correlational structures and identify appropriate adjustment sets for estimating causal effects1-4. The web-based application can be accessed at https://apps.gerkelab.com/shinyDAG/.

Key operations

Adding nodes and edges

Alt Text

Editing DAG aesthetics

Alt Text

Examplary usage

The following DAG was reproduced from "A structural approach to selection bias"5 (Figure 6A) using the shinyDAG web app.

alt text

For comparison, the DAG from the original article is shown below.

alt text

The DAG represents a study on the effects of antiretroviral therapy (E) on AIDS risk (D), where immunosuppression (U) is unmeasured. L represents presence of symptoms (such as fever, weight loss, and diarrhea) and C represents censoring. A spurious path exists between E and D due to selection bias. We can see this in shinyDAG by ensuring that we've selected E as the exposure, D as the outcome, adjusted for C, and then toggling the "Examine DAG elements" button in the bottom left corner. The spurious open path is displayed as D <- U -> L -> C <- E.

alt text

One possible resolution for this bias is to adjust for L. After toggling L in the "Select nodes to adjust" section, we see that all spurious E to D paths are now closed.

alt text

Other features

In addition PDF and PNG exports, users can download R objects in ggdag or daggity formats, as well as the source LaTeX code. The "Edit LaTeX" pane permits in-app modification of the LaTeX code with a preview window; however, users should be aware that the information in "Examine DAG elements" is not responsive to changes in the Edit LaTeX pane.

shinyDAG should work in most modern web browsers, however, we have observed optimal performance in Chrome. The most notable difference across OS/browsers is likely to be in display handling for the PDF preview in the main panel: various user or browser-specific settings will determine the default zoom level.

Citing shinyDAG

shinyDAG was developed by Jordan Creed, Garrick Aden-Buie and Travis Gerke.

Concept DOI: 10.5281/zenodo.1288712

v0.1.0 DOI: 10.5281/zenodo.1296477

v0.0.0 DOI: 10.5281/zenodo.1288713

References

  1. Richard Iannone (NA). DiagrammeR: Graph/Network Visualization. R package version 1.0.0. https://github.com/rich-iannone/DiagrammeR.
  2. Johannes Textor and Benito van der Zander (2016). dagitty: Graphical Analysis of Structural Causal Models. R package version 0.2-2. https://CRAN.R-project.org/package=dagitty.
  3. Malcolm Barrett (2018). ggdag: Analyze and Create Elegant Directed Acyclic Graphs. R package version 0.1.0. https://CRAN.R-project.org/package=ggdag.
  4. Csardi G, Nepusz T: The igraph software package for complex network research, InterJournal, Complex Systems 1695. 2006. http://igraph.org.
  5. Hernan MA, Hernandez-Díaz S, Robins JM. A structural approach to selection bias. Epidemiology 2004;15:615-625.

shinydag's People

Contributors

gadenbuie avatar jhcreed avatar tgerke avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.