VPCgraph: The original visual predictive check plot (VPC)

View source: R/VPCgraph.R

VPCgraphR Documentation

The original visual predictive check plot (VPC)

Description

This function draws the original visual predictive check plot proposed by Holford & Karlsson (2008). The visual predictive check plot is a graphical comparison of the distribution of observations and simulated data from the fitted model. In the "scatter" type of the VPC plot, dots indicate the observed data. Two dashed blue lines and one solid line represent profiles of percentiles of the simulated data. If the fitted model represents the observed data well, most observed data are between two dashed blue lines. In the "percentile" type of the VPC plot, profiles of percentiles from the observed data are compared to profiles of percentiles from the simulated data. Red lines represent profiles from the observed data, and blue lines represent profiles from the simulated data. If the fitted model represents the observed data well, two profiles in each percentile - one from the original data and the other from the simulated data - are similar. In the "CI" type of the VPC plot, sky blue and pink areas represent the confidence areas of the profile in each percentile. These confidence areas were calculated from the simulated data. In this plot, it is necessary to verify that the profiles of the original data are in confidence areas of each profile from the simulated data in each percentile. If each percentile line of the observed data is in the corresponding confidence area, this can be evidence that the fitted model represents the observed data quite well. Otherwise, the fitted model needs to be improved.

Usage

VPCgraph(orig_data,
         sim_data,
         type = "CI",                   
         N_xbin = NULL,
         probs = c(0.1,0.5,0.9),
         conf.level = 0.95,
         X_name = "TIME",
         Y_name = "DV",
         MissingDV = NULL,
         DV_point = TRUE,
         CIvpc_type = "line",
         bin_grid = TRUE,
         plot_caption = TRUE,
         plot_flag = TRUE,
         linesize = 0.7,
         pointsize = 0.7,
         captionsize = 10,
         Kmethod = "cluster",                   
         maxK = NULL,
         beta = 0.2,
         lambda = 0.3,
         R = 4,
         C1 = 2.5,
         C2 = 7.8, ...)

Arguments

orig_data

A data frame of original data with X and Y variable.

sim_data

A matrix of simulated data with only Y values collected.

type

Type of VPC graph; "CI", "percentile", or "scatter".

N_xbin

Number of bins in X variable. If NULL, optimal number of bins are automatically calcuated using optK function.

probs

A numeric vector of probabilities.

conf.level

Confidence level of the interval.

X_name

Name of X variable in orig_data (usually "TIME" in pharmacokinetic data).

Y_name

Name of Y variable in orig_data (usually "DV" in pharmacokinetic data).

MissingDV

Name of missing indicator variable in orig_data, which have value 1 if missing, value 0 otherwise. (usually "MDV" in pharmacokinetic data).

DV_point

Draw point (X, Y) in the plot if TRUE; omit if FALSE.

CIvpc_type

Type of CI area in VPC graph; "line" or "segment".

bin_grid

Draw grid lines for binning in X variable if TRUE; omit if FALSE.

plot_caption

Put caption with additional information if TRUE; omit if FALSE.

plot_flag

Draw plot if TRUE; generate data for drawing plot if FALSE.

linesize

Size of line in the plot.

pointsize

Size of point in the plot.

captionsize

Size of caption .

Kmethod

The way to calculate the penalty in automatic binning."cluster" or "kernel".

maxK

The maximum number of bins.

beta

Additional parameter for automatic binning, used in optK function.

lambda

Additional parameter for automatic binning, used in optK function.

R

Additional parameter for automatic binning, used in optK function.

C1

Additional parameter for automatic binning, used in optK function.

C2

Additional parameter for automatic binning, used in optK function.

...

Arguments to be passed to methods.

Value

Visual predictive check plot or the values to draw VPC plot.

References

Holford N, & Karlsson M. (2008). "A tutorial on visual predictive checks, abstr 1434." Annual Meeting of the Populations Approach Group in Europe. www.page-meeting.org. 2008.

Harling, Uekcert, K. 2018. VPC and NPC User Guide. ICON plc.

https://github.com/UUPharmacometrics/PsN/releases/download/4.9.0/vpc_npc_userguide.pdf.

Examples


data(origdata)
data(simdata)
VPCgraph(origdata,simdata,type="CI",X_name="TIME",Y_name="DV",N_xbin=8)


nlmeVPC documentation built on Dec. 28, 2022, 2:49 a.m.

Related to VPCgraph in nlmeVPC...