MonolixSuite in R
Auto Light Dark
Auto Light Dark

plotBESubjectByFormulation

[PKanalix] Plot subject-by-formulation

Plot the Bioequivalence parameters as Subject-by-formulation.

Usage

R
plotBESubjectByFormulation(
  parameters = NULL,
  formulations = NULL,
  settings = list(),
  preferences = NULL,
  stratify = list()
)

Arguments

parameters

(vector) vector of NCA parameters (included in BE calculations) to display. (by default the first 4 computed parameters are displayed).

formulations

(vector) vector of test (i.e non-ref) formulations to display. (by default the first 4 test formulations are displayed).

settings

List with the following settings:

  • dots (logical) If TRUE, NCA parameters are displayed as dots (default TRUE).

  • lines (logical) If TRUE, NCA parameters belonging to the same individual are connected by lines (default TRUE).

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

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

  • ylog (logical) If TRUE, log-scale on y axis is used (default TRUE).

  • ncol (logical) Number of columns to arrange the subplots (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("plotBESubjectByFormulation") 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 given in parameters

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

See also

getPlotPreferences

Examples

R
initializeLixoftConnectors(software = "pkanalix")
project <- file.path(getDemoPath(), "/3.bioequivalence/project_crossover_bioequivalence.pkx")
loadProject(project)
runNCAEstimation()
runBioequivalenceEstimation()

# display by default
plotBESubjectByFormulation()

Default plotBESubjectByFormulation output for the crossover bioequivalence demo. Three stacked subject-by-formulation panels for AUC0-inf, AUC0-tlast and Cmax, each with dots at test and ref on the x axis and a line joining the two values of each individual. AUC values range about 45 to 240 h.mg per L, Cmax about 3.5 to 11.5 mg per L, with Cmax mostly higher for ref.
R

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

# select only a subplot of parameters used for BE analysis
# if several test formulations are compared w.r.t a reference formulation, it is also possible to select which test formulation to display
plotBESubjectByFormulation(parameters = c("AUCINF_obs","Cmax"),
                           formulations = c("test"))

plotBESubjectByFormulation output restricted to AUCINF_obs and Cmax and the test formulation. Two stacked panels, AUC0-inf in h.mg per L and Cmax in mg per L, each showing individual values at test and ref joined by a line per subject. Most Cmax lines rise from test to ref.
R

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

# changing the settings
plotBESubjectByFormulation(parameters = c("AUCINF_obs","Cmax"),
                           settings=list(dots=T,
                                         lines=T,
                                         legend=T,
                                         grid=F,
                                         ylog=T,
                                         units=F,
                                         fontsize=9))

plotBESubjectByFormulation output with custom settings, AUC0-inf and Cmax panels on a log y scale, without grid and without units in the axis labels, using a smaller font. Each individual is a pair of dots at test and ref joined by a line. A legend below lists Individual parameters for the dots and Lines for the connecting lines.
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
plotBESubjectByFormulation(parameters = c("AUCINF_obs","Cmax"),
                           settings=list(legend=T),
                           preferences = list(formulationDot=list(color="#202120",
                                                                  radius=4,
                                                                  shape=18,
                                                                  legend="NCA parameter for each formulation"),
                                              formulationLine=list(color="#202120",
                                                                   lineWidth=0.5,
                                                                   lineType="dashed",
                                                                   legend="Individuals")))

plotBESubjectByFormulation output with custom preferences. AUC0-inf and Cmax panels show values at test and ref as black diamonds joined by black dashed lines per subject. The legend below reads NCA parameter for each formulation for the diamonds and Individuals for the dashed lines.
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]


# define groups of WT and split by WT
plotBESubjectByFormulation(parameters = c("AUCINF_obs","Cmax"),
                           stratify=list(groups=list(name="WT", definition=c(70)),
                                         split=c("WT")))

plotBESubjectByFormulation output split by weight groups defined with a break at WT 70. A 2 by 2 grid shows AUC0-inf in the top row and Cmax in the bottom row, with columns for WT 65-70 and WT 70-83. Each panel shows individual values at test and ref joined by a line per subject.
R

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

# define groups of AGE and WT and filter by AGE and WT
plotBESubjectByFormulation(parameters = c("AUCINF_obs","Cmax"),
                           stratify=list(groups=list(list(name="WT", definition=c(70)),
                                                     list(name="AGE", definition=c(24,34))),
                                         filter=list(list("AGE",c(1,3)),
                                                     list("WT",2))))

plotBESubjectByFormulation output filtered by AGE and WT groups, leaving only five individuals. Two stacked panels, AUC0-inf in h.mg per L and Cmax in mg per L, each with five lines joining the test and ref values of each subject.
R

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


Last updated: