MonolixSuite in R
Auto Light Dark
Auto Light Dark

plotNCAParametersDistribution

[PKanalix] Distribution of the individual NCA parameters

Plot the distribution of the individual NCA parameters.

Usage

R
plotNCAParametersDistribution(
  parameters = NULL,
  settings = list(),
  preferences = list(),
  stratify = list()
)

Arguments

parameters

(vector) vector of NCA parameters to display. (by default the first 12 computed NCA parameters are displayed).

settings

List with the following settings:

  • plot (character) Type of plot: probability density distribution as histogram ("pdf", default), or cumulative density distribution ("cdf").

  • legend (logical) If TRUE, plot legend is displayed (default FALSE).

  • grid (logical) If TRUE, plot grid is displayed (default TRUE).

  • ncol (integer) number of columns to arrange subplots (default 4).

  • fontsize (integer) Font size of text elements (default 11).

  • units (logical) If TRUE, units are added in axis labels (default TRUE).

  • scales (character) Should scales be fixed ("fixed"), free ("free", default), or free in one dimension ("free_x", "free_y").

preferences

(optional) preferences for plot display, run getPlotPreferences("plotNCAParametersDistribution") to check available options.

stratify

List with the stratification arguments:

  • groups - Definition of stratification groups. By default, stratification groups are already defined as one group for each category for categorical covariates, and two groups of equal number of individuals for continuous covariates. To redefine groups, for each covariate to redefine, specify a list with:

    name

    character

    covariate name (e.g "AGE")

    definition

    vector(continuous) || list>(categorical)

    For continuous covariates, vector of break values (e.g c(35, 65)). For categorical covariates, groups of categories as a list of vectors(e.g list(c("study101"), c("study201","study202")))

  • split (vector) - Vector of covariates used to split (i.e facet) the plot (by default no split is applied). For instance c("FORM","AGE").

  • filter (list< list> >) - List of pairs containing a covariate name and the vector of indexes or categories (for categorical covariates) of the groups to keep (by default no filtering is applied). For instance, list("AGE",c(1,3)) to keep the individuals belonging to the first and third age group, according to the definition in groups. For instance, list("FORM","ref") using the category name for categorical covariates.

Value

  • A ggplot object if only one parameter is specified in parameters

  • A TableGrob object if multiple plots (output of grid.arrange)

See also

getChartsData getPlotPreferences

Examples

R
  initializeLixoftConnectors(software = "pkanalix")
  project <- file.path(getDemoPath(), "/2.case_studies/project_Theo_extravasc_SD.pkx")
  loadProject(project)
  runNCAEstimation()
  
# plot a single parameter, as pdf or cdf
plotNCAParametersDistribution(parameters = "AUCINF_obs", settings = list(plot = "pdf"))

Histogram from plotNCAParametersDistribution of AUCINF_obs, labeled AUC0-inf in h times mg per L, with density on the y-axis. Six bins span about 47 to 240. The tallest bin, about 112 to 144, reaches a density of 0.012, with a second peak of about 0.008 near 180 to 210.
R

plotNCAParametersDistribution(parameters = "Lambda_z", settings = list(plot = "cdf"))

Empirical cumulative distribution plot from plotNCAParametersDistribution of Lambda_z, labeled kel in per hour, with probability from 0 to 1 on the y-axis. The step-like curve rises steeply from about 0.07 to 0.14 and then flattens up to about 0.225.
R

  
# with a single parameter, a ggplot object if returned and additional ggplot elements can be added
library(ggplot2)
plotNCAParametersDistribution(parameters = "AUCINF_obs")+geom_vline(xintercept=140)

Histogram of AUCINF_obs, labeled AUC0-inf in h times mg per L, with density on the y-axis, the same as the default plot but with a black vertical line at 140 added using the ggplot2 function geom_vline. The line falls inside the tallest bin, about 112 to 144.
R


# display only 4 parameters in a 2x2 matrix (ncol=2)
plotNCAParametersDistribution(parameters = c('AUCINF_obs', 'AUClast', 'Cl_F_obs', 'Clast'),
                              settings = list(ncol=2))

plotNCAParametersDistribution output with 4 histograms in a 2 by 2 layout, density versus AUC0-inf and AUC0-tlast in h times mg per L, CL over F in L per h, and Clast in mg per L. Both AUCs range about 47 to 240 and peak near 112 to 144. CL over F is right-skewed from about 2.5 to 12.7. Clast ranges about 0.04 to 0.35 and peaks near 0.15 to 0.19.
R

#> TableGrob (1 x 1) "arrange": 1 grobs
#>   z     cells    name            grob
#> 1 1 (1-1,1-1) arrange gtable[arrange]

# changing the settings to choose which elements to display
plotNCAParametersDistribution(parameters = c('AUCINF_obs', 'AUClast', 'Cl_F_obs', 'Clast'),
                              settings = list(ncol=2,
                                              units=F,
                                              legend=T,
                                              grid=F,
                                              fontsize=9))

The same 4 histograms of AUC0-inf, AUC0-tlast, CL over F and Clast in a 2 by 2 layout, drawn with units hidden, grid removed, smaller font and a legend at the bottom reading Empirical distribution. Axis labels show parameter names only, without units.
R

#> TableGrob (2 x 1) "arrange": 2 grobs
#>   z     cells    name              grob
#> 1 1 (1-1,1-1) arrange   gtable[arrange]
#> 2 2 (2-2,1-1) arrange gtable[guide-box]

# changing the preferences (appearance of the elements) when using plot="cdf"
plotNCAParametersDistribution(parameters = c('AUCINF_obs', 'AUClast', 'Cl_F_obs', 'Clast'),
                             settings = list(ncol=2, legend=T, plot="cdf"),
                             preferences = list(empirical=list(color="#161617",
                                                               lineWidth=1,
                                                               lineType="solid",
                                                               legend="cumulative density distribution")))

plotNCAParametersDistribution output with cumulative distribution plots of AUC0-inf, AUC0-tlast, CL over F and Clast in a 2 by 2 layout, probability from 0 to 1 versus each parameter. The curves are drawn as thick black lines through preferences, and the legend reads cumulative density distribution.
R

#> TableGrob (2 x 1) "arrange": 2 grobs
#>   z     cells    name              grob
#> 1 1 (1-1,1-1) arrange   gtable[arrange]
#> 2 2 (2-2,1-1) arrange gtable[guide-box]

# changing the preferences (appearance of the elements) when using plot="pdf"
plotNCAParametersDistribution(parameters = c('AUCINF_obs', 'AUClast', 'Cl_F_obs', 'Clast'),
                              settings = list(ncol=2, legend=T, plot="pdf"),
                              preferences = list(histogramBar=list(fill="#cdced1",
                                                                   opacity=0.7,
                                                                   stroke="#161617",
                                                                   strokeWidth=1,
                                                                   legend="probability density distribution")))

plotNCAParametersDistribution output with histograms of AUC0-inf, AUC0-tlast, CL over F and Clast in a 2 by 2 layout, density on the y-axis. Bars use custom preferences, light gray fill with thick black outlines, and the legend reads probability density distribution.
R

#> TableGrob (2 x 1) "arrange": 2 grobs
#>   z     cells    name              grob
#> 1 1 (1-1,1-1) arrange   gtable[arrange]
#> 2 2 (2-2,1-1) arrange gtable[guide-box]

# split each plot into two subplots for FORM=ref and FORM=test
plotNCAParametersDistribution(parameters = c('AUCINF_obs', 'AUClast', 'Cl_F_obs', 'Clast'),
                              settings = list(ncol=2),
                              stratify = list(split=c("FORM")))

plotNCAParametersDistribution output with histograms of AUC0-inf, AUC0-tlast, CL over F and Clast, where each parameter is split into two subplots, FORM ref and FORM test. Density is on the y-axis. The distributions are broadly similar between formulations, and each formulation has one high CL over F value near 10 to 12.
R

#> TableGrob (1 x 1) "arrange": 1 grobs
#>   z     cells    name            grob
#> 1 1 (1-1,1-1) arrange gtable[arrange]

# define groups for AGE and HT, filter by AGE and split by HT
plotNCAParametersDistribution(parameters = c('AUCINF_obs', 'AUClast', 'Cl_F_obs', 'Clast'),
                              settings=list(ncol=2),
                              stratify = list(groups=list(list(name="AGE", definition=c(30, 35)),
                                                          list(name="HT", definition=c(184.5))),
                                              filter=list("AGE",c(1,3)),
                                              split="HT"))

plotNCAParametersDistribution output with histograms of AUC0-inf, AUC0-tlast, CL over F and Clast, filtered to AGE groups 1 and 3 and split by HT into two subplots, HT 176-184.5 and HT 184.5-191. The taller HT group has fewer values, so its histograms have only three bins, for example CL over F from about 3 to 6.
R

#> TableGrob (1 x 1) "arrange": 1 grobs
#>   z     cells    name            grob
#> 1 1 (1-1,1-1) arrange gtable[arrange]

# filter to keep only second sequence (TR) and Period=1
plotNCAParametersDistribution(parameters = c('AUCINF_obs', 'AUClast', 'Cl_F_obs', 'Clast'),
                              settings=list(ncol=2),
                              stratify = list(filter=list(list("SEQ",2),list("Period","1"))))

plotNCAParametersDistribution output filtered to sequence TR and Period 1, with histograms of AUC0-inf, AUC0-tlast, CL over F and Clast in a 2 by 2 layout. With few individuals, each histogram has three bins. Both AUCs show flat bars from about 47 to 225, CL over F decreases from about 2.7 to 12.7, and Clast ranges about 0.08 to 0.25.
R

#> TableGrob (1 x 1) "arrange": 1 grobs
#>   z     cells    name            grob
#> 1 1 (1-1,1-1) arrange gtable[arrange]
  


Last updated: