Skip to contents

Draws the app's plot for a result of mvp_simulate(), mvp_sensitivity() or mvp_batch():

  • typical subject: the simulated profile (Simulation page);

  • population: median and prediction interval, or individual profiles (Variability page);

  • sensitivity: one profile per parameter value (Parameter Sensitivity page);

  • batch: a tornado or spider plot of an exposure metric.

Usage

mvp_plot(
  x,
  var = NULL,
  log_y = FALSE,
  log_x = FALSE,
  title = NULL,
  xlab = NULL,
  ylab = NULL,
  points = FALSE,
  observed = NULL,
  interval = c(0.025, 0.975),
  individuals = FALSE,
  mean = FALSE,
  window = NULL,
  target = NULL,
  target_time = NULL,
  type = c("tornado", "spider"),
  metric = "AUC",
  display = c("Percentage", "Ratio", "Value"),
  top = 20
)

Arguments

x

An mvp_sim object.

var

Output to plot (default: the model's first captured output).

log_y, log_x

Log scale for the y / x axis.

title, xlab, ylab

Plot title and axis labels (defaults as in the app).

points

Also show the sampling times as points: on the profile (typical subject, sensitivity) or on the median (population). Useful with sparse or custom sampling, where the lines between samples are not simulated.

observed

Optional observed data to overlay: mvp_observed(), or a data frame (columns ID, TIME in model time units, DV).

interval

Population: lower and upper quantiles of the prediction interval (default 2.5th to 97.5th percentile, as in the app).

individuals

Population: show individual profiles instead of the prediction interval.

mean

Population: add a dashed line for the mean.

window

Time window c(start, end) in model time units. Typical subject and population: the part of the x axis shown (e.g. the last dosing interval); sensitivity: shaded under each curve; batch: the window of the exposure metric.

target

Optional value drawn as a dashed horizontal line, e.g. a target concentration (see mvp_target() for the percentage of subjects above it).

target_time

Optional time (model time units) drawn as a dashed vertical line, e.g. the time of a target, as the app's "Show X-intercept".

type

Batch: "tornado" or "spider".

metric

Batch: exposure metric, one of "AUC", "Cmax", "Cmin", "Cavg", "Clast", "Tmax", "Tmin".

display

Batch: show the metric as "Percentage" change from the reference, "Ratio" to the reference, or "Value".

top

Batch: show the most sensitive top parameters.

Value

A ggplot object.

Examples

# \donttest{
if (interactive()) {
  sim <- mvp_simulate(mvp_model("1cmt"), dose = mvp_dose(100, ii = 24, n = 5),
                      times = mvp_times(120), population = 50)
  mvp_plot(sim, "CP", log_y = TRUE)
}
# }