Creates a VPC plot from observed and simulation data for censored data. Function can handle both left- (below lower limit of quantification) and right-censored (above upper limit of quantification) data.
vpc_cens(
sim = NULL,
obs = NULL,
psn_folder = NULL,
bins = "jenks",
n_bins = 8,
bin_mid = "mean",
obs_cols = NULL,
sim_cols = NULL,
software = "auto",
show = NULL,
stratify = NULL,
stratify_color = NULL,
ci = c(0.05, 0.95),
uloq = NULL,
lloq = NULL,
xlab = "Time",
ylab = "Probability of a list containing calculated VPC information (when vpcdb=TRUE), or a ggplot2 object (default)
this is usually a data.frame with observed data, containing the independent and dependent variable, a column indicating the individual, and possibly covariates. E.g. load in from NONMEM using read_table_nm. However it can also be an object like a nlmixr or xpose object
a data.frame with observed data, containing the independent and dependent variable, a column indicating the individual, and possibly covariates. E.g. load in from NONMEM using read_table_nm
instead of specifying "sim" and "obs", specify a PsN-generated VPC-folder
either "density", "time", or "data", "none", or one of the approaches available in classInterval() such as "jenks" (default) or "pretty", or a numeric vector specifying the bin separators.
when using the "auto" binning method, what number of bins to aim for
either "mean" for the mean of all timepoints (default) or "middle" to use the average of the bin boundaries.
list for mapping observation data columns, e.g. `list(dv = "DV", id = "ID", idv = "TIME", pred="PRED")`
list for mapping simulation data columns, e.g. `list(dv = "DV", id = "ID", idv = "TIME", pred="PRED")`
name of software platform using (e.g. nonmem, phoenix)
what to show in VPC (obs_dv, obs_ci, pi, pi_as_area, pi_ci, obs_median, sim_median, sim_median_ci)
character vector of stratification variables. Only 1 or 2 stratification variables can be supplied.
variable to stratify and color lines for observed data. Only 1 stratification variables can be supplied.
confidence interval to plot. Default is (0.05, 0.95)
Number or NULL indicating upper limit of quantification. Default is NULL.
Number or NULL indicating lower limit of quantification. Default is NULL.
label for x axis
label for y axis
title
"smooth" the VPC (connect bin midpoints) or show bins as rectangular boxes. Default is TRUE.
theme to be used in VPC. Expects list of class vpc_theme created with function vpc_theme()
either "wrap", "columns", or "rows"
ggplot2 labeller function to be passed to underlying ggplot object
boolean whether to return the underlying vpcdb rather than the plot
show debugging information (TRUE or FALSE)
vpc, vpc_tte, vpc_cat
## See vpc.ronkeizer.com for more documentation and examples
library(vpc)
vpc_cens(sim = simple_data$sim, obs = simple_data$obs, lloq = 30)
vpc_cens(sim = simple_data$sim, obs = simple_data$obs, uloq = 120)
Run the code above in your browser using DataLab