Description Usage Arguments Value See Also Examples
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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | 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,
plot = FALSE,
xlab = "Time",
ylab = "Probability of <LOQ",
title = NULL,
smooth = TRUE,
vpc_theme = NULL,
facet = "wrap",
labeller = NULL,
vpcdb = FALSE,
verbose = FALSE
)
|
sim |
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 |
obs |
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 |
psn_folder |
instead of specifying "sim" and "obs", specify a PsN-generated VPC-folder |
bins |
either "density", "time", or "data", or a numeric vector specifying the bin separators. |
n_bins |
number of bins |
bin_mid |
either "mean" for the mean of all timepoints (default) or "middle" to use the average of the bin boundaries. |
obs_cols |
observation dataset column names (list elements: "dv", "idv", "id", "pred") |
sim_cols |
simulation dataset column names (list elements: "dv", "idv", "id", "pred") |
software |
name of software platform using (e.g. nonmem, phoenix) |
show |
what to show in VPC (obs_ci, pi, pi_as_area, pi_ci, obs_median, sim_median, sim_median_ci) |
stratify |
character vector of stratification variables. Only 1 or 2 stratification variables can be supplied. |
stratify_color |
variable to stratify and color lines for observed data. Only 1 stratification variables can be supplied. |
ci |
confidence interval to plot. Default is (0.05, 0.95) |
uloq |
Number or NULL indicating upper limit of quantification. Default is NULL. |
lloq |
Number or NULL indicating lower limit of quantification. Default is NULL. |
plot |
Boolean indicating whether to plot the ggplot2 object after creation. Default is FALSE. |
xlab |
ylab as numeric vector of size 2 |
ylab |
ylab as numeric vector of size 2 |
title |
title |
smooth |
"smooth" the VPC (connect bin midpoints) or show bins as rectangular boxes. Default is TRUE. |
vpc_theme |
theme to be used in VPC. Expects list of class vpc_theme created with function vpc_theme() |
facet |
either "wrap", "columns", or "rows" |
labeller |
ggplot2 labeller function to be passed to underlying ggplot object |
vpcdb |
boolean whether to return the underlying vpcdb rather than the plot |
verbose |
show debugging information (TRUE or FALSE) |
a list containing calculated VPC information, and a ggplot2 object
sim_data, vpc, vpc_tte, vpc_cat
1 2 3 4 5 | ## 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.