This function can be used for either single time-to-event (TTE) or repeated time-to-event (RTTE) data.
vpc_tte(
sim = NULL,
obs = NULL,
psn_folder = NULL,
rtte = FALSE,
rtte_calc_diff = TRUE,
rtte_conditional = TRUE,
events = NULL,
bins = FALSE,
n_bins = 10,
software = "auto",
obs_cols = NULL,
sim_cols = NULL,
kmmc = NULL,
reverse_prob = FALSE,
stratify = NULL,
stratify_color = NULL,
ci = c(0.05, 0.95),
plot = FALSE,
xlab = "Time",
ylab = "Survival (%)",
show = NULL,
as_percentage = TRUE,
title = NULL,
smooth = FALSE,
vpc_theme = NULL,
facet = "wrap",
labeller = NULL,
verbose = FALSE,
vpcdb = FALSE
)
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
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
repeated time-to-event data? Default is FALSE (treat as single-event TTE)
recalculate time (T/F)? When simulating in NONMEM, you will probably need to set this to TRUE to recalculate the TIME to relative times between events (unless you output the time difference between events and specify that as independent variable to the vpc_tte() function.
`TRUE` (default) or `FALSE`. Compute the probability for each event newly (`TRUE`), or calculate the absolute probability (`FALSE`, i.e. the "probability of a 1st, 2nd, 3rd event etc" rather than the "probability of an event happening").
numeric vector describing which events to show a VPC for when repeated TTE data, e.g. c(1:4). Default is NULL, which shows all events.
either "density", "time", or "data", or a numeric vector specifying the bin separators.
number of bins
name of software platform using (e.g. nonmem, phoenix)
observation dataset column names (list elements: "dv", "idv", "id", "pred")
simulation dataset column names (list elements: "dv", "idv", "id", "pred", "sim")
either NULL (for regular TTE vpc, default), or a variable name for a KMMC plot (e.g. "WT")
reverse the probability scale (i.e. plot 1-probability)
character vector of stratification variables. Only 1 or 2 stratification variables can be supplied.
character vector of stratification variables. Only 1 stratification variable can be supplied, cannot be used in conjunction with `stratify`.
confidence interval to plot. Default is (0.05, 0.95)
Boolean indicating whether to plot the ggplot2 object after creation. Default is FALSE.
label for x-axis
label for y-axis
what to show in VPC (obs_ci, obs_median, sim_median, sim_median_ci)
Show y-scale from 0-100 percent? TRUE by default, if FALSE then scale from 0-1.
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
TRUE or FALSE (default)
Boolean whether to return the underlying vpcdb rather than the plot
a list containing calculated VPC information, and a ggplot2 object
Creates a VPC plot from observed and simulation survival data
# NOT RUN {
## See vpc-docs.ronkeizer.com for more documentation and examples.
## Example for repeated) time-to-event data
## with NONMEM-like data (e.g. simulated using a dense grid)
data(rtte_obs_nm)
data(rtte_sim_nm)
# treat RTTE as TTE, no stratification
vpc_tte(sim = rtte_sim_nm[rtte_sim_nm$sim <= 20,],
obs = rtte_obs_nm,
rtte = FALSE,
sim_cols=list(dv = "dv", idv = "t"), obs_cols=list(idv = "t"))
# }
Run the code above in your browser using DataLab