Learn R Programming

vpc (version 1.2.4)

Create Visual Predictive Checks

Description

Visual predictive checks are a commonly used diagnostic plot in pharmacometrics, showing how certain statistics (percentiles) for observed data compare to those same statistics for data simulated from a model. The package can generate VPCs for continuous, categorical, censored, and (repeated) time-to-event data.

Copy Link

Version

Install

install.packages('vpc')

Monthly Downloads

1,455

Version

1.2.4

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Ron Keizer

Last Published

February 17th, 2026

Functions in vpc (1.2.4)

quantile_cens

Calculate quantiles respecting the censored data
ggplot2_label_variable

Function copied from ggplot2:::label_variable, with addition of ` Copied here since CRAN does not like use of `:::`.
ggplot.vpcdb_continuous

Create a ggplot for each vpcdb type
calc_vpc_continuous

Calculate aggregate statistics for simulated and observed VPC data
pk_oral_1cmt

Simulate PK data from a 1-compartment oral model
plot_vpc

VPC plotting function
add_noise

Add noise / residual error to data
plot_vpc_helper

Helper function to simplify vpc plotting (not intended to be called directly)
add_sim_index_number

Add sim index number
loq_frac

Calculate fraction of observations below lloq / above uloq
label_vpc_tte

Custom ggplot2 labeller function.
show_default

Defaults for show argument with various endpoint types
simple_data

A small rich dataset
theme_plain

A nicer default theme for ggplot2
pred_correction_core

Core prediction correction function
triangle_to_full

Lower to full triangle
replace_list_elements

Replace list elements by name
read_vpc

Read in VPC data
rtte_obs_nm

Simulated RTTE data (1x)
read_table_nm

NONMEM output table import function
pk_iv_1cmt

Simulate PK data from a 1-compartment iv model
new_vpc_theme

Create a customized VPC theme
standardize_column

Confirm that a column is in the data, and rename data to prepare that column for later use.
theme_empty

Empty ggplot2 theme
rtte_sim_nm

Simulated RTTE data (100x)
vpc_ggplot

A collection of internal ggplot helpers for VPC plotting
vpc_cens

VPC function for left- or right-censored data (e.g. BLOQ data)
vpc_cat

VPC function for categorical
vpc_tte

VPC function for time-to-event (survival) data
vpc

VPC function
vpc-package

vpc: Create Visual Predictive Checks
check_stratification_columns_available

Check whether stratification columns are available
as_vpcdb

Create a vpcdb object, and standardize parameter checking
auto_bin

Calculate appropriate bin separators for vpc
calc_pred_corr_continuous

Perform prediction-correction
compute_kaplan

Compute Kaplan-Meier statistics
add_stratification

Adds stratification to data set
bin_data

Function to bin data based on a vector of bin separators, e.g. for use in VPC
draw_params_mvr

Draw parameters from multivariate distribution
define_loq

Check and standardize limits of quantification
filter_dv

Remove values that are not observed values from data
format_vpc_input_data

Prepare VPC data for future calculations by standardizing column names and modifying the input data based on the limits of quantification, stratification, and logarithmic values.
compute_kmmc

Compute KMMC statistics
create_vpc_theme

Create new vpc theme
define_bins

Define bins for many types of data
define_data_columns

Define data column defaults for various softwares