plot_vpc {pharmr}R Documentation

plot_vpc

Description

Creates a VPC plot for a model

Usage

plot_vpc(
  model,
  simulations,
  binning = "equal_number",
  nbins = 8,
  qi = 0.95,
  ci = 0.95,
  stratify_on = NULL
)

Arguments

model

(Model) Pharmpy model

simulations

(data.frame or str) DataFrame containing the simulation data or path to dataset. The dataset has to have one (index) column named "SIM" containing the simulation number, one (index) column named "index" containing the data indices and one dv column. See below for more information.

binning

(str) Binning method. Can be "equal_number" or "equal_width". The default is "equal_number".

nbins

(numeric) Number of bins. Default is 8.

qi

(numeric) Upper quantile. Default is 0.95.

ci

(numeric) Confidence interval. Default is 0.95.

stratify_on

(str (optional)) Parameter to use for stratification. Optional.

Value

(alt.Chart) Plot The simulation data should have the following format: +—–+——-+——–+ | SIM | index | DV | +=====+=======+========+ | 1 | 0 | 0.000 | +—–+——-+——–+ | 1 | 1 | 34.080 | +—–+——-+——–+ | 1 | 2 | 28.858 | +—–+——-+——–+ | 1 | 3 | 0.000 | +—–+——-+——–+ | 1 | 4 | 12.157 | +—–+——-+——–+ | 2 | 0 | 23.834 | +—–+——-+——–+ | 2 | 1 | 0.000 | +—–+——-+——–+ | ... | ... | ... | +—–+——-+——–+ | 20 | 2 | 0.000 | +—–+——-+——–+ | 20 | 3 | 31.342 | +—–+——-+——–+ | 20 | 4 | 29.983 | +—–+——-+——–+

Examples

## Not run: 
model <- load_example_model("pheno")
sim_model <- set_simulation(model, n=100)
sim_data <- run_simulation(sim_model)
plot_vpc(model, sim_data)

## End(Not run)


[Package pharmr version 1.0.1 Index]