Logo

The Data Daily

Using Flexdashboards to Monitor Clinical Research

Using Flexdashboards to Monitor Clinical Research

Using Flexdashboards to Monitor Clinical Research
POST
Using Flexdashboards to Monitor Clinical Research
February 9, 2018
Dashboards != Communication
Much of my work involves prospective clinical research, where data collection can take months or years to complete and relies on continuous effort from multidisciplinary teams. Throughout the study, we monitor progress in various ways, such as…
Rates of enrollment and reasons for patient exclusion, to make sure our study pace is on target and the cohort reflects the population we intended to study
Open-label medication use, to make sure we can draw reliable conclusions about the actual difference between our treatments
Key aspects of the study protocol, such as making sure study devices are worn consistently
Follow-up rates, to alert us when we need new strategies to maintain contact with patients and their families over years of follow-up
In previous studies, our critical care research organization used weekly PDF reports created in knitr/LaTeX to monitor study progress. While helpful, their length and detail tend to bury our most important metrics amid numbers that we only need occasionally. For our most recent study, I created a flexdashboard which summarizes our most important metrics of study progress in a way that
Gives us a quick, clear overview of what’s happening;
Provides additional detail as needed via interactive graphics; and
Updates on every run by accessing our database API.
The entire project can be found in this Github repo ; it includes an .Rmd file for the actual dashboard which sources a .R script for data preparation.
Study Background
The MOSAIC (Measuring OutcomeS of Activity in Intensive Care) study will evaluate the relationship between patients’ activity levels during their ICU stay and their disability, physical function, and cognition up to a year after their critical illness. More information on the study can be found on clinicaltrials.gov .
We started data collection in March 2017, and will eventually enroll 312 patients from the Vanderbilt ICUs. As patient enrollment and follow-up continue, we want to monitor rates of screening, enrollment, and follow-up and to make sure that key study data is being collected while patients are in the hospital. Enter the flexdashboard!
Screencap of MOSAIC dashboard
Out of an abundance of caution for sharing patient information, I’m not sharing the actual dashboard here.
Flexdashboard Primer for the Unfamiliar
RMarkdown, saved with the .Rmd extension, allows us to interweave R code with Markdown text and create output in HTML, PDF, and other formats. flexdashboards are a specific type of HTML output which emphasizes data visualizations. Use your .Rmd YAML to specify this output type and set a few options:
--- title: "MOSAIC Study Progress" output: flexdashboard::flex_dashboard: orientation: columns vertical_layout: fill theme: cosmo logo: favicon_48x48.png favicon: favicon_48x48.png ---
If you use RStudio, flexdashboards are also available as an RMarkdown template when you create a new file. RStudio’s flexdashboard page has more!
Flexdashboards can include interactive components using Shiny . That level of interactivity wouldn’t add much value for our single-center study, and I wanted to be able to send a static file to our team (vs requiring an internet connection), so we stick to the simpler non-Shiny version. For multicenter studies, I think using Shiny or trelliscopejs have a lot of potential for looking at overall numbers as well as individual site metrics.
Particularly Helpful Features
Rather than repeat how-to information you can find in the very helpful flexdashboard docs, I’ll highlight some features and capabilities I’ve found particularly useful in the context of clinical research monitoring.
Separate Pages for Separate Topics
Most of our studies are divided into three phases, each conducted by different teams within our group. Having one flexdashboard page per phase helps each team quickly focus attention on the most relevant metrics for their work. It’s easy to do using Markdown headers:
Screening & Enrollment ===================================== In-Hospital ===================================== Follow-Up ===================================== Study & Technical Info =====================================
Interactive Graphics
There are quite a few ways to incorporate interactive graphics into a flexdashboard (see htmlwidgets for one great list of options); thus far, I’ve mainly used plotly , which has allowed us to focus on the big picture quickly while incorporating detailed information in tooltips. For example, we have 17 separate reasons for study exclusion, and want to track how these change over time. Using text or legends to denote which line is which exclusion would take up valuable screen real estate; by including that information in tooltips instead, we can access that information only when we need it. plotly’s zoom capabilities are also really helpful for investigating data points more closely.
Hierarchical Treemaps with the treemap and highcharter Packages
Treemaps are another useful way for us to quickly get an overview of some piece of study information, then drill down for more detail as needed. For example, we’ve grouped our 17 exclusions into a few major categories. A quick look at our treemap gives us a great broad sense of why patients are being excluded. If we’re curious about what specific medical reasons are excluding patients, for example, we can drill down and see those details.
Code for treemap

Images Powered by Shutterstock