This vignette includes code to generate Figure 2 from the paper: a scatterplot matrix of pairwise joint distributions of five physiological parameters.
To use this code, you need virtual population data generated in the Subpopulations vignette. (To reproduce the plot exactly, you need to set the seed before generating the populations, as in the Subpopulations vignette.)
First, load some packages.
Next, read in the data. Figure 2 used the Age 20-65 subpopulation.
Add a factor to each data table showing which method was used to generate that population.
The physiological variables of interest here are:
(As noted in the paper, these quantities were chosen because global sensitivity analysis showed that
Css was primarily sensitive to these, as opposed to other, physiological quantities.)
Portal vein flow is the only one not already included in the data tables. To calculate it, we just need to sum the arterial flows to the liver and to the gut. Let’s do that for both the virtual-individuals and the direct-resampling virtual populations.
Next, let’s define the variables of interest and
rbind together those variables from the two virtual populations.
For better readability in the plot, let’s change the capitalization and punctuation of the variable names, since they’ll be used for labels.
Finally, let’s make the plot.
theme_set(theme_bw()) p <- ggpairs(data=bothpop, columns=1:9, linetype='which_method', color='which_method', upper=list(continuous='blank'), lower=list(continuous='density'), diag=list(continuous='density'), axisLabels='show', legends=TRUE) print(p) pdf("pdf_figures/Figure2.pdf", height=12, width=12) print(p) dev.off()