Skip to content
dicook edited this page Feb 20, 2015 · 8 revisions

Create a shiny app with ggvis plots for diagnosing nonlinear mixed effects models

Summary: Nonlinear mixed effects models are used to study drug concentrations in clinical trials. Models are typically fitted using external software, NONMEM, MONOLIX, but sometimes using the nlme R package. Diagnosing these models is aided by good plots of the observed and fitted values, and covariates. Linking these plots should be possible using the new R package ggvis, and this is the goal of this project, to extend existing work to include linked plots.

Description: : Start with the fit4NM package, which is a RGtk2 GUI containing base graphics. This package plots patient drug concentration profiles, the fitted values, residuals, with some capacity for faceting by covariates. Versions of this package exist on CRAN for Windows and linux. The package fit4NM-EDA is a shell of a shiny app that uses ggplot2 graphics for a subset of the displays available in fit4NM. This code is available on github fit4NM. For this project we would like to generate plots using ggvis, and provide linking within and between the plots. Profile plots show drug concentration over time, for each patient, where points are connected by lines. With a lot of patients there are many overplotted lines. Being able to highlight one point and have the full profile for the patient will help understand the drug elimination patterns. Because each patient also typically has associated demographic information, like weight, age, gender, linking plots of these characteristics helps to assess demographic-specific drug effects. The app needs to take data from model fits made with packages like NONMEM and MONOLIX, or even nlme, and provide an interface to the user to select variables and types of plots.

Related work:

Potential tasks:

  • Take the shiny app shell from fit4NM-EDA, and re-do the plots using ggvis.
  • Profiles plots of drug concentration, where profiles can be selected by brushing a point.
  • Scatterplots, side-by-side boxplots, histograms of covariates displayed
  • Multiple plots displayed on the page should be linked so that a user selecting an element in one plot, will trigger appropriate highlighting in the other plots.

Question from TD Hocking 2015-02-19.

  • You could accomplish this interactive visualization easily using animint (probably in much less time than the 3 months of a GSOC project). And in fact Carson Sievert implemented Animint+Shiny integration in GSOC2014. Can you please provide some justification for why this project merits a 3-month GSOC project?
  • Answer from Di Cook: Providing an interface for diagnosing nonlinear mixed effect models is substantial, and very generally useful for various purposes. We are particularly interested in pharmacokinetic data modeling, and have access to lots of this types of data for testing, and colleagues who would be willing to test it, and need an interface. Some early work using ggobi can be viewed at this page. You are right, though, it may be worth considering using animint for the interactive graphics. We need to be able to do linking between plots using a third variable, a categorical variable. I would be happy revising the project for the student to explore the use of animint and ggvis for the interactive graphics.

Skills required:

  • Knowledge of shiny, ggvis, animint, basic statistical plots

Test: Make a scatter plot of these measurements in ggvis, which has basic categorical variable linking available. When the user selects a point from patient A, all observations from patient A will highlight.

Patient Time Conc
A 1 2.5
A 2 3.2
A 3 1.9
B 1 1.0
B 2 4.6
B 3 2.4

Mentor: Eun-Kyung Lee ([@](mailto:lee.eunk {at} gmail {dot} com)), Di Cook ([@](mailto:visnut {at} gmail {dot} com))

Disclaimer: