Giter Site home page Giter Site logo

sanoke / hetviz Goto Github PK

View Code? Open in Web Editor NEW
2.0 4.0 4.0 23.19 MB

Treatment Effect Heterogeneity visualization using R

License: GNU General Public License v3.0

R 98.42% CSS 1.58%
visualization shiny shiny-apps causal-inference treatment-effects

hetviz's People

Contributors

cchoirat avatar sanoke avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

hetviz's Issues

Deactivate UI elements that shouldn't be used at a certain time

Use Javascript (or, worst-case scenario, a color change) to deactivate user elements that shouldn't be accessed at certain points of UI interaction.

  • When the user presses the Generate visualizations button, the UI elements of the sidebar should be deactivated, including the Generate button itself.
  • The Reset button should be deactivated until the user presses the "Generate visualizations" button.
  • When the user presses the Reset button, the UI elements of the sidebar should be reactivated (need to fix other behaviors of the Reset button -- see #8).
  • In the Forest Plot tab, if the dataset is too "large", deactivate the option to plot data at the individual-level.
  • In the Forest Plot tab, use JavaScript to indicate to the user untenable plot option combinations (moved from sanoke/hetviz-dev#39).
  • In the Subgroup Profiles tab, use JavaScript to indicate to the user untenable plot option combinations.

Add better documentation within the UI

Within each pane, write in some comments + an example screenshot of what the user should expect to see. This includes information on the calculations used to generate the plot. This will be in the User Manual, and a link to the appropriate page will be provided in the UI.

  • Add description of the Forest Plot tab
  • Add description of the Subgroup Profile tab
  • Add description of the Viz by Subgroup tab
  • Add description of the Covariate Profile tab
  • Add description of the Viz by Covariate tab
  • Add overview of how to use the app

Make progress bar updates more accurate

At the moment, the progress bar update amounts are somewhat arbitrary. Would like to write a function to determine how much to increment (which is dependent on what type of plot is being generated) and use that function to do the increments.

Fix weird warning message in "Viz by Covar" tab

The correct figure is generated, but a weird error is printed to the console. It also looks like the app is doing calculations twice...?

Warning: Error in eval: incorrect length (0), expecting: 9215
Stack trace (innermost first):
    96: <Anonymous>
    95: stop
    94: filter_impl
    93: filter_.tbl_df
    92: filter_
    91: as.data.frame
    90: filter_.data.frame
    89: filter_
    88: dplyr::filter
    87: eval
    86: eval
    85: %>%
    84: vizByCovar [/Users/Baloo/GitHub/hetviz-dev/R/vizByCovar-plotFcn.R#194]
    83: eval [/Users/Baloo/GitHub/hetviz-dev/inst/shiny/server.R#519]
    82: eval
    81: withProgress
    80: "plotly"::"ggplotly" [/Users/Baloo/GitHub/hetviz-dev/inst/shiny/server.R#517]
    79: func
    78: origRenderFunc
    77: output$vizByCovar
     2: shiny::runApp
     1: hetviz [/Users/Baloo/GitHub/hetviz-dev/R/runShinyApp.R#18]

How to calculate the standard error of a polytomous covar?

I've been conflating the identification of dichotomous and polytomous covariates -- because they've been the same in the test data I've been using.

But at some point, I will need to separate this out and handle them differently.

  • In Subgroup Profiles, need to add calculations for the mean and SE of a polytomous variable.

Final steps...

  • Add the corrected functionality to the User Manual (at the moment, UM indicates there's only support for binary covariates).

Construct data for "complex data" option

  • Construct synthetic data from the CER analysis
  • Find two real clinical trial data sets.
  • Construct synthetic datasets from the two real datasets.
  • Provide script for user to generate these two synthetic datasets (in separate branch).
  • Document this script in the User Manual.

plotly::renderPlotly() takes several seconds to load w/ no notice to user

The initial plot takes a while to load, as does any modifications to the plot.

  • e.g., de/selecting a subgroup in the "Subgroup Profiles" panel

withProgress() doesn't help, because I would need to add incProgress() calls within the definition of plotly::renderPlotly().

So, need to research how to display some sort of busy signal to the user while the plot completes its rendering.

Fix behavior of reset button

  • Clear out text input boxes in the Data Preview tab
  • Clear out printing of variable names in the 'Data Preview' tab
  • Clear out name of file in File Upload section, in sidebar
  • Reset 'Data source' UI element to simple simulated data
  • Clear out any dataset that is 'loaded' into the app.

Creation of user-generated summary document

Would like the user to be able to create a summary document of plots and annotations from the application. Will need to put some thought into what this document will look like. But it will contain (list updated regularly):

  • Date / time of document creation
  • Name + version # of hetviz
  • Figures from the exploratory analysis, as selected by the user (these figures will be separated into sections, corresponding to the tabs in the UI).

plotly::ggplotly() analog to ggvis::bind_shiny()

plotly::ggplotly() doesn't have an analog to ggvis::bind_shiny()... in other words, it's not possible to dynamically create plotly plots, although it is in ggvis (e.g., each iteration of a for() loop generating a plot whose name depends on the iteration number of the loop).

So for now, I will use ggvis() but make a note for the future to program this functionality myself (this is a nontrivial task) and/or suggest to the plotly developers to create such a function.

[Moved from sanoke/hetviz-dev#44]

Fix outcome variable and treatment variable axis labels in plots

When a dataset is loaded, the names of certain variables (outcome, treatment, subgroup indicator, estimated ITR (if provided)) are changed to be compatible with some hard-coding.

These 'new' compatible names are contained in plots containing these data. Instead, these plots should display the name contained in the user's data.

Better consideration if invalid/empty subgroup

[An issue in the 'Viz by Subgroup' tab]

This issue is indicative of a larger problem, ensuring that the variable containing subgroup membership is coded properly.

Proper coding means that this variable takes consecutive integer values, starting at 1. Groups are numbered in order of increasing subgroup-specific average treatment effect (ATE).

At the moment, proper coding is an assumption, and I need to write a function to enforce it. If there's an empty subgroup / invalid subgroup number, no plots will display. (There's a notice to this effect in the panel.)

  • Write function to check that grouping variable is coded properly. Do group reassignment if needed.

In the interim, I'll provide a script for the user to do this check themselves. Eventually I will do this check within my application, and do some reassignment as needed.

Write function to ensure / create proper group coding

[Related to #24]

Proper subgroup coding means that this variable takes consecutive integer values, starting at 1. Groups are numbered in order of increasing subgroup-specific average treatment effect (ATE).

At the moment, proper coding is an assumption, and I need to write a function to create/enforce it. If there's an empty subgroup / invalid subgroup number, no plots will display. (There's a notice to this effect in the panel.)

Write function to check that grouping variable is coded properly. Do group reassignment if needed.
In the interim, I'll provide a script for the user to do this check themselves. Eventually I will do this check within my application, and do some reassignment as needed.

App crashes when user-provided data is selected but no data is provided

Trying to generate viz with user-provided data selected and no data actually uploaded crashes the app:

image

Warning: Error in if: argument is of length zero
Stack trace (innermost first):
    66: observeEventHandler [/Library/Frameworks/R.framework/Versions/3.4/Resources/library/hetviz/shiny/server.R#120]
     2: shiny::runApp
     1: hetviz [/Users/cchoirat/Documents/LocalGit/hetviz/R/runShinyApp.R#20]

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.