MonolixSuite in R
Auto Light Dark
Auto Light Dark

plotNCAParametersCorrelation

[PKanalix] Correlation between NCA individual parameters.

Plot the correlation between NCA individual parameters.

Usage

R
plotNCAParametersCorrelation(
  parametersRows = NULL,
  parametersColumns = NULL,
  settings = list(),
  preferences = NULL,
  stratify = list()
)

Arguments

parametersRows

(vector) vector with the names of NCA parameters to display on rows (by default the first 4 computed parameters are displayed).

parametersColumns

(vector) vector with the names of NCA parameters to display on columns (by default parametersColumns = parametersRows).

settings

List with the following settings:

  • regressionLine (logical) If TRUE, regression line is displayed (default TRUE).

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

  • 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 when using split (default 4).

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

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

preferences

(optional) preferences for plot display, run getPlotPreferences("plotNCAParametersCorrelation") 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.

  • color (vector) - Vector of covariates used for coloring (by default no coloring is applied). Coloring applies to dots of plots w.r.t continuous covariates, but not on histograms or boxplots. For instance c("FORM","AGE").

  • colors - Vector of colors to use when color argument is used. Takes precedence over colors defined in preferences. For instance c("#ebecf0","#cdced1","#97989c").

Value

  • A ggplot object if parametersRows and parametersColumns have only one element

  • 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()
  
# by default only the 4 first NCA parameters are shown
plotNCAParametersCorrelation()

Default output of plotNCAParametersCorrelation, a 4 by 4 scatter plot matrix of the first four NCA parameters, AUC0-inf, percent extrapolated AUC, AUC0-tlast and CL per F, with parameter names on the gray diagonal and a pink regression line in each panel. AUC0-inf and AUC0-tlast are almost perfectly correlated, and both decrease with CL per F.
R

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

# choosing to display only a subset of possible covariates and NCA parameters (same param on rows and columns)
plotNCAParametersCorrelation(parametersRows = c("Cmax","Lambda_z","AUCINF_obs"))

Output of plotNCAParametersCorrelation with the same parameters on rows and columns, Cmax, kel for Lambda_z, and AUC0-inf. A 3 by 3 scatter plot matrix with names on the gray diagonal and pink regression lines. Cmax and AUC0-inf show a clear positive correlation, while kel is only weakly related to the other two.
R

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

# selecting different parameters on rows and columns
plotNCAParametersCorrelation(parametersRows = c("AUCINF_obs","Cmax"),
                             parametersColumns = c("Lambda_z","Tmax"))

Output of plotNCAParametersCorrelation with different parameters on rows and columns. A 2 by 2 grid of scatter plots shows AUC0-inf and Cmax on the rows versus kel and Tmax on the columns, each with a pink regression line. AUC0-inf decreases slightly with kel, and the Tmax panels show values at discrete times from 6 to 14 h with almost flat regression lines.
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
plotNCAParametersCorrelation(settings = list(regressionLine=F,
                                             spline=T,
                                             legend=T,
                                             grid=F,
                                             units=F,
                                             fontsize=8))

Output of plotNCAParametersCorrelation with regressionLine off, spline on, legend on, grid off, units off and a font size of 8. A 4 by 4 scatter plot matrix of AUC0-inf, percent extrapolated AUC, AUC0-tlast and CL per F shows orange spline curves instead of regression lines, no grid, axis labels without units, and a legend for Individual parameters and Spline.
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)
plotNCAParametersCorrelation(parametersRows = c("Cmax","Lambda_z"),
                             settings=list(legend=T, spline=T),
                             preferences = list(obs=list(color="#202120",
                                                         radius=2,
                                                         shape=18,
                                                         legend="NCA parameter values"),
                                                regressionLine=list(color="#202120",
                                                                    lineWidth=1,
                                                                    lineType="dashed",
                                                                    legend="Linear regression line"),
                                                spline=list(color="#97989c",
                                                            lineWidth=1,
                                                            lineType="solid",
                                                            legend="Spline regression line")))

Output of plotNCAParametersCorrelation with custom preferences for Cmax and kel. The 2 by 2 matrix shows the off-diagonal scatter plots with black diamond markers, a black dashed linear regression line and a gray solid spline. The legend lists NCA parameter values, Linear regression line and Spline regression line. The correlation between Cmax and kel is weak.
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 subplot for FORM=ref and FORM=test, vertically (ncol=1)
plotNCAParametersCorrelation(parametersRows = c("Cmax","Lambda_z","AUCINF_obs"),
                             settings=list(ncol=1),
                             stratify = list(split=c("FORM")))

Output of plotNCAParametersCorrelation for Cmax, kel and AUC0-inf, split by FORM with ncol equals 1. Each off-diagonal cell of the 3 by 3 matrix contains two stacked scatter plots, one for FORM ref and one for FORM test, each with a pink regression line. The split panels are very compressed, so the y axis tick labels overlap.
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, color by HT and filter by AGE
plotNCAParametersCorrelation(settings=list(legend=T),
                             parametersRows = c("Cmax","Lambda_z"),
                             stratify = list(groups=list(list(name="AGE", definition=c(30, 35)),
                                                         list(name="HT", definition=c(184.5))),
                                             color="HT",
                                             colors=c("#cdced1","#161617"),
                                             filter=list("AGE",c(1,3))))

Output of plotNCAParametersCorrelation for Cmax and kel, with groups defined on AGE and HT, colored by HT and filtered by AGE. The 2 by 2 matrix shows scatter plots with an almost flat pink regression line. Points are light gray for HT 176 to 184.5 and black for HT 184.5 to 191, as listed in the Individual parameters legend.
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]

# filter to keep only second sequence (TR) and FORM=test
plotNCAParametersCorrelation(settings=list(legend=T),
                             parametersRows = c("Cmax","Lambda_z"),
                             stratify = list(filter=list(list("SEQ",2),list("FORM","test"))))

Output of plotNCAParametersCorrelation for Cmax and kel, filtered to keep only sequence 2 and FORM equals test. The 2 by 2 matrix shows scatter plots of about 10 individuals with an almost flat pink regression line, and a legend for Individual parameters and Regression line. Cmax ranges from about 4 to 10 and kel from about 0.07 to 0.11.
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]


Last updated: