MonolixSuite in R
Auto Light Dark
Auto Light Dark

plotParametersDistribution

[Monolix] Distribution of the individual parameters computed by Monolix

Plot the distribution of the individual parameters.

Usage

R
plotParametersDistribution(
  parameters = NULL,
  plot = "pdf",
  settings = list(),
  preferences = NULL,
  stratify = list()
)

Arguments

parameters

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

plot

(character) Type of plot: probability density distribution ("pdf"), cumulative density distribution ("cdf") (default "pdf)

settings

a list of optional plot settings:

  • indivEstimate Calculation of individual estimates: conditional mean ("mean"), conditional mode with EBE's ("mode"), conditional distribution ("simulated") (default "simulated").

  • empirical (logical) If TRUE, plot empirical density distribution (default TRUE).

  • theoretical (logical) If TRUE, plot theoretical density distribution (default TRUE).

  • legend (logical) add (TRUE) / remove (FALSE) plot legend (default FALSE).

  • grid (logical) add (TRUE) / remove (FALSE) plot grid (default TRUE).

  • ncol (integer) number of columns when facet = TRUE (default 4).

  • fontsize (integer) Plot text font size.

preferences

(optional) preferences for plot display, run getPlotPreferences("plotParametersDistribution") to check available displays.

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 one parameter,

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

See also

getChartsData getPlotPreferences

Examples

R
  initializeLixoftConnectors(software="monolix")
  project <- file.path(getDemoPath(), "1.creating_and_using_models",
                       "1.1.libraries_of_models", "theophylline_project.mlxtran")
  loadProject(project)

  runPopulationParameterEstimation()
  runConditionalDistributionSampling()
  
  plotParametersDistribution(parameters = "ka")

Output of plotParametersDistribution for ka, the default pdf plot. A histogram of the individual ka estimates is shown with density on the y axis and ka from 0 to 8 on the x axis. A black curve gives the theoretical density, which peaks near ka equals 1 with a long right tail. Most values are below 3, with a few up to 8.
R

  plotParametersDistribution(parameters = "Cl", plot = "pdf")

Output of plotParametersDistribution for Cl with plot equals pdf. A histogram of the individual Cl estimates between about 0.02 and 0.065 is shown with density on the y axis. A black theoretical density curve peaks near 0.038 and has a right tail up to about 0.11.
R

  plotParametersDistribution(parameters = "ka", plot = "cdf")

Output of plotParametersDistribution for ka with plot equals cdf. A blue step-like curve shows the empirical cumulative distribution of the individual ka estimates, and a black curve shows the theoretical cdf. Probability runs from 0 to 1 on the y axis and ka from 0 to 8 on the x axis. The two curves agree closely, with the empirical curve leveling off near 0.9 above ka 3.
R

  plotParametersDistribution(parameters = "ka", plot = "cdf",
                             settings = list(indivEstimate = "simulated"))

Output of plotParametersDistribution for ka with plot equals cdf and indivEstimate equals simulated, using parameters sampled from the conditional distribution. A blue empirical cumulative distribution curve is compared with a black theoretical cdf, with probability from 0 to 1 versus ka from 0 to 8. The two curves agree closely.
R

  plotParametersDistribution(parameters = "Cl", plot = "pdf",
                             settings = list(theoretical = F))

Output of plotParametersDistribution for Cl with plot equals pdf and theoretical equals FALSE. Only the histogram of the individual Cl estimates is shown, with no theoretical density curve. Cl ranges from about 0.02 to 0.065 and the tallest bar, near 0.047, reaches a density of about 49.
R

  
  # stratification
  plotParametersDistribution(stratify = list(filter = list("WEIGHT", 1),
                                             groups = list(name = "WEIGHT", definition = 75)))

Output of plotParametersDistribution with stratification, with WEIGHT groups split at 75 and a filter keeping the first WEIGHT group. Three side by side histograms of ka, V and Cl show the individual estimates of the filtered subset, each with a black theoretical density curve.
R

#> TableGrob (1 x 1) "arrange": 1 grobs
#>   z     cells    name            grob
#> 1 1 (1-1,1-1) arrange gtable[arrange]
  plotParametersDistribution(parameters = "Cl", stratify = list(split = "SEX"))

Output of plotParametersDistribution for Cl split by SEX. Two side by side panels, labeled SEX F and SEX M, show histograms of the individual Cl estimates with density on the y axis. Each panel has the same black theoretical density curve, peaking near 0.038.
R

  
  # update preferences
  preferences = list(theoretical = list(color = "#B4468A", lineType = "solid", lineWidth = 0.8))
  plotParametersDistribution(parameters = "ka", plot = "cdf", preferences = preferences)

Output of plotParametersDistribution for ka with plot equals cdf and updated preferences. The theoretical cdf is drawn as a thicker solid magenta line instead of black, next to the blue empirical cumulative distribution of the individual ka estimates. Probability from 0 to 1 is plotted versus ka from 0 to 8.
R

                        
  # multiple plots
  plotParametersDistribution(parameters = c("ka", "Cl"))

Output of plotParametersDistribution for ka and Cl together. Two side by side histograms show the individual estimates with density on the y axis, each with a black theoretical density curve. ka is right skewed with a peak near 1, and Cl is centered near 0.04.
R

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

Output of plotParametersDistribution with plot equals pdf for all parameters. Three side by side histograms of the individual estimates of ka, V and Cl are shown, with density on the y axis and a black theoretical density curve on each. V is centered near 0.45 and Cl near 0.04, and ka is right skewed.
R

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

Output of plotParametersDistribution with plot equals cdf for all parameters. Three side by side panels for ka, V and Cl compare the blue empirical cumulative distribution of the individual estimates with the black theoretical cdf, with probability from 0 to 1 on the y axis. The empirical and theoretical curves agree closely for all three parameters.
R

#> TableGrob (1 x 1) "arrange": 1 grobs
#>   z     cells    name            grob
#> 1 1 (1-1,1-1) arrange gtable[arrange]
  plotParametersDistribution(plot = "cdf", settings = list(indivEstimate = "simulated"))

Output of plotParametersDistribution with plot equals cdf and indivEstimate equals simulated, for all parameters. Three side by side panels for ka, V and Cl compare blue empirical cumulative distributions with the black theoretical cdf, with probability from 0 to 1 on the y axis. The curves agree closely.
R

#> TableGrob (1 x 1) "arrange": 1 grobs
#>   z     cells    name            grob
#> 1 1 (1-1,1-1) arrange gtable[arrange]
  plotParametersDistribution(plot = "pdf", settings = list(theoretical = F))

Output of plotParametersDistribution with plot equals pdf and theoretical equals FALSE, for all parameters. Three side by side histograms of the individual estimates of ka, V and Cl are shown with density on the y axis and no theoretical density curves.
R

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



Last updated: