Title: | Biomarker Prognostic Enrichment Tool for clinical trials with survival outcomes |
---|---|
Description: | Prognostic Enrichment is a clinical trial strategy of evaluating an intervention in a patient population with a higher rate of the unwanted clinical event than the broader patient population (R. Temple (2010) DOI:10.1038/clpt.2010.233). A higher event rate translates to a lower sample size for the clinical trial, which can have both practical and ethical advantages. This package provides tools to evaluate biomarkers for prognostic enrichment of clinical trials with survival/time-to-event outcomes. |
Authors: | Si Cheng [cre, aut], Kathleen F. Kerr [aut] |
Maintainer: | Si Cheng <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.1.0 |
Built: | 2025-02-24 05:18:52 UTC |
Source: | https://github.com/chengs94/biopetsurv |
This function simulates biomarkers and generates survival observations depending on biomarker values. The simulated data can be used to explore prognostic enrichment using surv_enrichment
.
sim_data(n = 500, biomarker = "normal", effect.size = 1.25, baseline.hazard = "constant", end.time = 10, end.survival = 0.5, shape = NULL, seed = 2333)
sim_data(n = 500, biomarker = "normal", effect.size = 1.25, baseline.hazard = "constant", end.time = 10, end.survival = 0.5, shape = NULL, seed = 2333)
n |
The number of observations to simulate. |
biomarker |
Character specifying the shape of the biomarker distribution. Choices are |
effect.size |
The hazard ratio corresponding to one standard deviation increment in the biomarker. |
baseline.hazard |
Character ("constant"/"increasing"/"decreasing") specifying whether the overall hazard in the population is constant, increasing or decreasing over time. |
end.time |
The length of observation in the simulated dataset. In the data simulation, any events after this time will be censored at this time. |
end.survival |
The survival rate in the population at the end of observation. |
shape |
(Optional) the Weibull shape parameter for the baseline hazard. Values smaller and larger than 1 correspond to decreasing and increasing respectively. |
seed |
(Optional) specify the random seed used for simulation. |
The biomarker will be simulated from a standardized normal or lognormal distribution. It is important that effect.size
should correspond to a 1 SD increment in the biomarker. Conditioning on the biomarker values and assuming proportional hazards, survival times are simulated from a Weibull distribution with user-specified shape parameter, and the scale parameter is determined by the specified event rate and effect size.
Returns a list of the following items:
data |
A data frame with 4 columns: the value of biomarker, observed event time, event indicator and the true event time. |
km.plot |
The Kaplan-Meier survival curves of the simulated dataset at enrichment levels 0, 25%, 50% and 75%. |
## Simulate a dataset with 500 observations, where the biomarker is Normally distributed (with SD=1). ## The hazard ratio corresponding to every one unit of increament in the biomarker is 1.25. ## The observation period is 10 months and the survival probability of the population at the end of observation is 0.5. ## Hazards are constant over time. library(survival) library(ggplot2) sim_obj <- sim_data(n = 500, biomarker = "normal", effect.size = 1.25, baseline.hazard = "constant", end.time = 10, end.survival = 0.5) dat <- sim_obj$data
## Simulate a dataset with 500 observations, where the biomarker is Normally distributed (with SD=1). ## The hazard ratio corresponding to every one unit of increament in the biomarker is 1.25. ## The observation period is 10 months and the survival probability of the population at the end of observation is 0.5. ## Hazards are constant over time. library(survival) library(ggplot2) sim_obj <- sim_data(n = 500, biomarker = "normal", effect.size = 1.25, baseline.hazard = "constant", end.time = 10, end.survival = 0.5) dat <- sim_obj$data
This function evaluates biomarkers for prognostic enrichment of clinical trials with survival outcomes, using data with biomarker values and survival observations.
surv_enrichment(formula, data, hr = 0.8, end.of.trial=NULL, a=NULL, f=NULL, method = "KM", lambda = 0.05, cost.screening = NULL, cost.keeping = NULL, cost.unit.keeping = NULL, power = 0.9, alpha = 0.05, one.sided = F, selected.biomarker.quantiles = seq(from = 0, to = 0.95, by = 0.05), do.bootstrap = FALSE, n.bootstrap = 1000, seed = 2333, print.summary.tables = FALSE)
surv_enrichment(formula, data, hr = 0.8, end.of.trial=NULL, a=NULL, f=NULL, method = "KM", lambda = 0.05, cost.screening = NULL, cost.keeping = NULL, cost.unit.keeping = NULL, power = 0.9, alpha = 0.05, one.sided = F, selected.biomarker.quantiles = seq(from = 0, to = 0.95, by = 0.05), do.bootstrap = FALSE, n.bootstrap = 1000, seed = 2333, print.summary.tables = FALSE)
formula |
Object of class |
data |
Data frame containing the survival outcome (as returned by |
hr |
The hazard ratio (comparing the treatment versus control group) that the trial seeks to detect. Should be a number between 0 and 1. |
end.of.trial |
A scalar or a vector that gives the duration(s) of fixed-length trial(s) that are being considered. The unit of time should be the same as the survival times in the data. Either |
a |
A scalar specifying the accrual period of the trial. It is assumed that patients are recruited at a uniform rate during this period. |
f |
A scalar specifying the follow-up period of the trial, that is, all patients are followed during this period right after the accrual period. |
method |
Character specifying which method would be used to estimate event probabilities. Choices are |
lambda |
The smoothing parameter used by method |
cost.screening |
(Optional) the cost of measuring the biomarker for each patient to determine eligibility for the trial. |
cost.keeping |
(Optional) the cost of enrolling and retaining a patient in a trial. If specified for a trial with accrual and follow-up periods, it is treated as the "average" cost for one patient under such design, and is used for all patients in the trial. |
cost.unit.keeping |
(Optional) the cost of enrolling and retaining a patient per unit time in the trial. Can be specified as an alternative to |
power |
The power (probability of rejecting the null hypothesis given that it is false) for sample size calculation. |
alpha |
The type I error rate (probability of falsely rejecting the null given that it is true) for sample size calculation. |
one.sided |
Logical indicating whether the alternative hypothesis is one-sided (instead of two-sided). Default is |
selected.biomarker.quantiles |
Numeric vector specifying the quantiles of the biomarker measured in controls that will be used to screen trial participants. Default is 0, 0.05, ..., 0.95. All entries must be between at least 0 and less than 1. |
do.bootstrap |
Logical specifying whether bootstrap standard errors should be calculated for a trial with accrual and follow-up periods. Default is |
n.bootstrap |
Number of bootstrap samples for standard error estimation. |
seed |
Specify the random seed used to generate bootstrap samples. |
print.summary.tables |
Logical specifying whether a table of clinical trial metrics should be printed. |
Returns a list of the following items:
summary.table |
A matrix containing all clinical trial metrics that were calculated (listed below) at each enrichment level. |
event.prob |
Vector(s) of estimated event probabilities at each enrichment level. If more than one vector was presented, each column corresponds to a specified length of trial. |
event.prob.se |
Estimated standard errors of event probabilities at each enrichment level for each trial length. |
n.patients |
Vector(s) of clinical trial sample size required. |
n.patients.se |
Estimated standard errors of the sample sizes. |
n.screened |
The number of patients that need to be screened to enroll the trial. |
n.screened.se |
Estimated standard errors of |
cost |
The estimated total cost of the trial, combining screening costs and the total cost of patients in the trial. |
cost.se |
Estimated standard errors of |
cost.reduction |
The reduction in total cost comparing an enriched trial to an unenriched trial. A positive number indicates that an enriched trial would cost less than an unenriched one. |
cost.reduction.se |
Estimated standard errors of |
response |
The response (a Survival object) specified in argument |
biomarker |
The biomarker, or the composite biomarker calculated via Cox regression. |
All other quantities are the same as the input by user.
Heagerty, Patrick J., Thomas Lumley, and Margaret S. Pepe. "Time-dependent ROC curves for censored survival data and a diagnostic marker." Biometrics 56.2 (2000): 337-344.
Heagerty, Patrick J., Paramita Saha-Chaudhuri, and Maintainer Paramita Saha-Chaudhuri. "Package 'survivalROC'." (2013).
library(survival) data(SurvMarkers) ## Using biomarker x2 to plan fixed length trials of 36 and 48 months, ## where the cost for screening is $300 per patient, ## and the cost for running a patient through the trial is $4000 and $5000 respectively. ## We wish to detect a hazard ratio of 0.8 with a two-sided test, with type I error 0.05 and power 0.9. ## The Kaplan-Meier method is used to calculate event probabilities. SurvMarkers$surv <- Surv(SurvMarkers$time, SurvMarkers$event) rslt1 <- surv_enrichment(formula = surv~x2, data = SurvMarkers, hr = 0.8, end.of.trial=c(36,48), cost.screening = 300, cost.keeping = c(4000,5000), cost.unit.keeping = NULL, method = "KM", power = 0.9, alpha = 0.05, one.sided = FALSE, selected.biomarker.quantiles = seq(from = 0, to = 0.9, by = 0.1), do.bootstrap = FALSE, print.summary.tables = FALSE) ## Using a composite biomarker (combining x1 and x2) to plan a trial ## with an accrual period of 12 months and a follow-up period of 36 months. ## The cost for keeping a patient in the trial is $300/month. ## Compute bootstrap standard errors for the estimated values. rslt2 <- surv_enrichment(formula = surv~x1+x2, data = SurvMarkers, hr = 0.8, a=12, f=36, cost.screening = 300, cost.keeping = NULL, cost.unit.keeping = 300, method = "KM", power = 0.9, alpha = 0.05, one.sided = FALSE, selected.biomarker.quantiles = seq(from = 0, to = 0.9, by = 0.1), do.bootstrap = TRUE, n.bootstrap = 500, print.summary.tables = FALSE) ## An analog of the first example, using the nearest neighbor estimator for event probabilities rslt3 <- surv_enrichment(formula = surv~x2, data = SurvMarkers, hr = 0.8, end.of.trial=36, cost.screening = 300, cost.keeping = 4000, cost.unit.keeping = NULL, method = "NNE", power = 0.9, alpha = 0.05, one.sided = FALSE, selected.biomarker.quantiles = seq(from = 0, to = 0.9, by = 0.1), do.bootstrap = FALSE, print.summary.tables = FALSE)
library(survival) data(SurvMarkers) ## Using biomarker x2 to plan fixed length trials of 36 and 48 months, ## where the cost for screening is $300 per patient, ## and the cost for running a patient through the trial is $4000 and $5000 respectively. ## We wish to detect a hazard ratio of 0.8 with a two-sided test, with type I error 0.05 and power 0.9. ## The Kaplan-Meier method is used to calculate event probabilities. SurvMarkers$surv <- Surv(SurvMarkers$time, SurvMarkers$event) rslt1 <- surv_enrichment(formula = surv~x2, data = SurvMarkers, hr = 0.8, end.of.trial=c(36,48), cost.screening = 300, cost.keeping = c(4000,5000), cost.unit.keeping = NULL, method = "KM", power = 0.9, alpha = 0.05, one.sided = FALSE, selected.biomarker.quantiles = seq(from = 0, to = 0.9, by = 0.1), do.bootstrap = FALSE, print.summary.tables = FALSE) ## Using a composite biomarker (combining x1 and x2) to plan a trial ## with an accrual period of 12 months and a follow-up period of 36 months. ## The cost for keeping a patient in the trial is $300/month. ## Compute bootstrap standard errors for the estimated values. rslt2 <- surv_enrichment(formula = surv~x1+x2, data = SurvMarkers, hr = 0.8, a=12, f=36, cost.screening = 300, cost.keeping = NULL, cost.unit.keeping = 300, method = "KM", power = 0.9, alpha = 0.05, one.sided = FALSE, selected.biomarker.quantiles = seq(from = 0, to = 0.9, by = 0.1), do.bootstrap = TRUE, n.bootstrap = 500, print.summary.tables = FALSE) ## An analog of the first example, using the nearest neighbor estimator for event probabilities rslt3 <- surv_enrichment(formula = surv~x2, data = SurvMarkers, hr = 0.8, end.of.trial=36, cost.screening = 300, cost.keeping = 4000, cost.unit.keeping = NULL, method = "NNE", power = 0.9, alpha = 0.05, one.sided = FALSE, selected.biomarker.quantiles = seq(from = 0, to = 0.9, by = 0.1), do.bootstrap = FALSE, print.summary.tables = FALSE)
This function plots summaries of prognostic enrichment of clinical trials with survival outcomes, based on clinical trial metrics estimated by surv_enrichment
.
surv_plot_enrichment(x, km.quantiles = c(0,0.25,0.5,0.75), km.range = NULL, alt.color = NULL)
surv_plot_enrichment(x, km.quantiles = c(0,0.25,0.5,0.75), km.range = NULL, alt.color = NULL)
x |
Object returned by |
km.quantiles |
Enrichment levels on which Kaplan-Meier survival estimates (Plot 1) are plotted. Defaults to four quartiles. |
km.range |
(Optional) a scalar specifying the range of time for which Kaplan-Meier survival estimates (Plot 1) are plotted. Defaults to the last time point of observation. |
alt.color |
(Optional) allows the user to specify the color of curves for clinical trial metrics (Plots 2-6). The length should match the number of trial lengths considered. Defaults to |
A grid containing either the first 4 or 6 plots described below.
km.plot |
The Kaplan-Meier survival curves for specified enrichment levels. The vertical reference line(s) correspond to |
prob.plot |
The estimated event probability (and 95% confidence intervals) at each enrichment level. |
ss.plot |
The estimated sample size (and confidence intervals) at each enrichment level. |
screen.plot |
The estimated number of patients that need to be screened (and confidence intervals) to enroll the trial. |
cost.plot |
The estimated total cost of the trial (and confidence intervals). |
reduction.cost.plot |
The percentage of reduction in total cost comparing an enriched versus unenriched trial. |
summary |
A grid of the first 4 or all 6 plots combined together. |
## Following the example of 'surv_enrichment': library(survival) library(ggplot2) library(gridExtra) data(SurvMarkers) SurvMarkers$surv <- Surv(SurvMarkers$time, SurvMarkers$event) rslt1 <- surv_enrichment(formula = surv~x2, data = SurvMarkers, hr = 0.8, end.of.trial=c(36,48), cost.screening = 300, cost.keeping = c(4000,5000), cost.unit.keeping = NULL, method = "KM", power = 0.9, alpha = 0.05, one.sided = FALSE, selected.biomarker.quantiles = seq(from = 0, to = 0.9, by = 0.1), do.bootstrap = FALSE, print.summary.tables = FALSE) ## Truncate the range of x axis in the Kaplan-Meier plot to 0-60 months, and use colors 'salmon' and 'royalblue' for 36- and 48-month trials respectively. plots1 <- surv_plot_enrichment(rslt1, km.quantiles = c(0,0.25,0.5,0.75), km.range = 60, alt.color = c("salmon","royalblue"))
## Following the example of 'surv_enrichment': library(survival) library(ggplot2) library(gridExtra) data(SurvMarkers) SurvMarkers$surv <- Surv(SurvMarkers$time, SurvMarkers$event) rslt1 <- surv_enrichment(formula = surv~x2, data = SurvMarkers, hr = 0.8, end.of.trial=c(36,48), cost.screening = 300, cost.keeping = c(4000,5000), cost.unit.keeping = NULL, method = "KM", power = 0.9, alpha = 0.05, one.sided = FALSE, selected.biomarker.quantiles = seq(from = 0, to = 0.9, by = 0.1), do.bootstrap = FALSE, print.summary.tables = FALSE) ## Truncate the range of x axis in the Kaplan-Meier plot to 0-60 months, and use colors 'salmon' and 'royalblue' for 36- and 48-month trials respectively. plots1 <- surv_plot_enrichment(rslt1, km.quantiles = c(0,0.25,0.5,0.75), km.range = 60, alt.color = c("salmon","royalblue"))
A dataset containing values of two biomarkers and survival outcomes of 1533 individuals.
data(SurvMarkers)
data(SurvMarkers)
A data frame with 1533 rows and 4 variables:
observed times of event or censoring
indicator of event; 0 means censored and 1 means event
A modestly prognostic biomarker (concordance index=0.64)
A strongly prognostic biomarker (concordance index=0.82)