Title: | Create and Evaluate Stopping Rules for Safety Monitoring |
---|---|
Description: | Provides functions for creating, displaying, and evaluating stopping rules for safety monitoring in clinical studies. Implements stopping rule methods described in Goldman (1987) <doi:10.1016/0197-2456(87)90153-X>; Geller et al. (2003, ISBN:9781135524388); Ivanova, Qaqish, and Schell (2005) <doi:10.1111/j.1541-0420.2005.00311.x>; Chen and Chaloner (2006) <doi:10.1002/sim.2429>; and Kulldorff et al. (2011) <doi:10.1080/07474946.2011.539924>. |
Authors: | Michael J. Martens [aut, cre], Qinghua Lian [aut], Brent R. Logan [ctb] |
Maintainer: | Michael J. Martens <[email protected]> |
License: | GPL-3 |
Version: | 0.5.1 |
Built: | 2024-12-06 10:21:15 UTC |
Source: | CRAN |
A wrapper function to calculate the boundary for a given stopping rule for safety monitoring for time-to-event data or binary data
bdryfcn(data.type, ...)
bdryfcn(data.type, ...)
data.type |
Type of data, choices include 'bin' for binary data and 'surv' for time-to-event data |
... |
Other options to be passed to the corresponding stopping rule calculation. Please refer to the corresponding data type-specific |
A univariate function that defines the rejection boundary at any number of evaluable patients (binary data) or amount of follow-up time (time-to-event data)
Calculate the boundary for a given stopping rule
bdryfcn.bin(n, p0, type, cval, param = NULL)
bdryfcn.bin(n, p0, type, cval, param = NULL)
n |
Maximum sample size for safety monitoring |
p0 |
The toxicity probability under the null hypothesis |
type |
The method used for constructing the stopping rule. Choices include a Pocock test ("Pocock"), an O'Brien-Fleming test ("OBF"), a Wang-Tsiatis test ("WT"), the Bayesian beta-binomial method ("BB") proposed by Geller et al. 2003, the Bayesian beta-binomial method ("CC") proposed by Chen and Chaloner 2006, a truncated SPRT ("SPRT"), and a maximized SPRT ("MaxSPRT"). |
cval |
Critical value for stopping rule method. For Wang-Tsiatis tests, this is the Delta parameter. For the Bayesian Beta-Binomial method, this is the threshold on the posterior probability. For the truncated SPRT, this is the threshold on the log likelihood ratio. For the MaxSPRT, this is the threshold on the log generalized likelihood ratio. |
param |
A vector of the extra parameter(s) needed for certain stopping rule methods. For binomial Wang-Tsiatis tests, this is the Delta parameter. For the Geller et al. method, this is the vector of hyperparameters (a,b) for the beta prior on the toxicity probability. For Chen and Chaloner's method, this is the vector (a,b,p1,nu), containing the hyperparameters (a,b) for the beta prior on the toxicity probability, the targeted alternative toxicity probability p1, and the threshold nu for the posterior probability that the true toxicity probability p > p1. For truncated SPRT, this is the targeted alternative toxicity probability p1. |
A univariate function that defines the rejection boundary at any number of evaluable patients
Calculate the boundary for a given stopping rule
bdryfcn.surv(n, p0, type, tau, cval, param = NULL)
bdryfcn.surv(n, p0, type, tau, cval, param = NULL)
n |
Maximum sample size for safety monitoring |
p0 |
The probability of a toxicity occurring in |
type |
The method used for constructing the stopping rule. Choices including a Pocock test ("Pocock"), a O'Brein-Fleming test ("OBF"), a Wang-Tsiatis test ("WT"), the Bayesian Gamma-Poisson method ("GP"), a truncated sequential probability ratio test ("SPRT"), and a maximized SPRT ("MaxSPRT") |
tau |
Length of observation period |
cval |
Critical value for the stopping rule. For Wang-Tsiatis tests, this is the Delta parameter. For the Bayesian Gamma-Poisson method, this is the threshold on the posterior probability. For the truncated SPRT, this is the threshold on the log likelihood ratio. For the MaxSPRT, this is the threshold on the log generalized likelihood ratio. |
param |
A vector of the extra parameter(s) needed for certain stopping rule methods. For Wang-Tsiatis tests, this is the Delta parameter. For truncated SPRT, this is the targeted alternative toxicity probability p1. For Bayesian Gamma-Poisson model, this is the vector of hyperparameters (shape,rate) for the gamma prior on the toxicity event rate. |
A univariate function that defines the rejection boundary at any amount of total follow-up time
Internal workhorse function to calculate stopping boundary for a given method, treating toxicities as binary data
calc.bnd.bin(n, p0, type, cval, param)
calc.bnd.bin(n, p0, type, cval, param)
n |
Maximum sample size for safety monitoring |
p0 |
The toxicity probability under the null hypothesis |
type |
The method used for constructing the stopping rule |
cval |
Critical value for stopping rule method. For Wang-Tsiatis tests, this is the Delta parameter. For the Bayesian Beta-Binomial method, this is the threshold on the posterior probability. For the truncated SPRT, this is the threshold on the log likelihood ratio. For the MaxSPRT, this is the threshold on the log generalized likelihood ratio. |
param |
A vector of the extra parameter(s) needed for certain stopping rule methods. For binomial Wang-Tsiatis tests, this is the Delta parameter. For the Geller et al. method, this is the vector of hyperparameters (a,b) for the beta prior on the toxicity probability. For Chen and Chaloner's method, this is the vector (a,b,p1,nu), containing the hyperparameters (a,b) for the beta prior on the toxicity probability, the targeted alternative toxicity probability p1, and the threshold nu for the posterior probability that the true toxicity probability p > p1. For truncated SPRT, this is the targeted alternative toxicity probability p1. |
A vector of stopping boundaries at the sample sizes 1, 2, ..., n
Internal workhorse function to calculate stopping boundary for a given method for time-to-event data
calc.bnd.surv(n, p0, type, tau, cval, maxInf = "expected", param = NULL)
calc.bnd.surv(n, p0, type, tau, cval, maxInf = "expected", param = NULL)
n |
maximum sample size for safety monitoring |
p0 |
The probability of a toxicity occurring in |
type |
The method used for constructing the stopping rule |
tau |
Length of observation period |
cval |
Critical value for the stopping rule. For Wang-Tsiatis tests, this is the Delta parameter. For the Bayesian Gamma-Poisson method, this is the threshold on the posterior probability. For the truncated SPRT, this is the threshold on the log likelihood ratio. For the MaxSPRT, this is the threshold on the log generalized likelihood ratio. |
maxInf |
Specification of the maximum information (maximum exposure time) used for designing the stopping rule. Options include the expected exposure time for n patients used H0 ("expected") and the maximum possible exposure time ("maximum"). Default is "expected" (expected exposure time in cohort). |
param |
A vector of the extra parameter(s) needed for certain stopping rule methods. For Wang-Tsiatis tests, this is the Delta parameter. For truncated SPRT, this is the targeted alternative toxicity probability p1. For Bayesian Gamma-Poisson model, this is the vector of hyperparameters (shape,rate) for the gamma prior on the toxicity event rate. |
A list of three items: tau, number of events that can trigger a stop, and the corresponding total follow up time.
A wrapper function to calculate a stopping rule for safety monitoring for time-to-event data or binary data
calc.rule(data.type, ...)
calc.rule(data.type, ...)
data.type |
Type of data, choices include 'bin' for binary data and 'surv' for time-to-event data |
... |
Other options to be passed to the corresponding stopping rule calculation. Please refer to the corresponding data type-specific |
Please refer to the corresponding data type-specific calc.rule()
function for details on its output
calc.rule(data.type="bin",ns=1:50,p0=0.20,alpha=0.10,type="WT",param=0.25) calc.rule(data.type="surv",n=50,p0=0.20,alpha=0.10,type="WT",tau=100,param=0.25)
calc.rule(data.type="bin",ns=1:50,p0=0.20,alpha=0.10,type="WT",param=0.25) calc.rule(data.type="surv",n=50,p0=0.20,alpha=0.10,type="WT",tau=100,param=0.25)
Calculate a stopping rule for safety monitoring, treating toxicities as binary data
calc.rule.bin(ns, p0, alpha, type, param = NULL, iter = 50)
calc.rule.bin(ns, p0, alpha, type, param = NULL, iter = 50)
ns |
A vector of sample sizes at which sequential testing is performed |
p0 |
The toxicity probability under the null hypothesis |
alpha |
The desired type I error / false positive rate for the stopping rule |
type |
The method used for constructing the stopping rule. Choices include a Pocock test ("Pocock"), an O'Brien-Fleming test ("OBF"), a Wang-Tsiatis test ("WT"), the Bayesian beta-binomial method ("BB") proposed by Geller et al. 2003, the Bayesian beta-binomial method ("CC") proposed by Chen and Chaloner 2006, a truncated SPRT ("SPRT"), and a maximized SPRT ("MaxSPRT"). |
param |
A vector of the extra parameter(s) needed for certain stopping rule methods. For binomial Wang-Tsiatis tests, this is the Delta parameter. For the Geller et al. method, this is the vector of hyperparameters (a,b) for the beta prior on the toxicity probability. For Chen and Chaloner's method, this is the vector (a,b,p1,nu), containing the hyperparameters (a,b) for the beta prior on the toxicity probability, the targeted alternative toxicity probability p1, and the threshold nu for the posterior probability that the true toxicity probability p > p1. For truncated SPRT, this is the targeted alternative toxicity probability p1. |
iter |
The number of iterations used to search for the boundary |
A rule.bin object, which is a list with the following elements: Rule, a two-column matrix with the sample sizes ns
and their corresponding rejection boundaries; ns
; p0
; alpha
; type
; param
; and cval, the boundary parameter for the rule
Chen, C. and Chaloner, K. (2006). A Bayesian stopping rule for a single arm study: With a case study of stem cell transplantation. Statistics in Medicine 25(17), 2956-66.
Geller, N.L., Follman, D., Leifer, E.S. and Carter, S.L. (2003). Design of early trials in stem cell transplantation: a hybrid frequentist-Bayesian approach. Advances in Clinical Trial Biostatistics.
Goldman, A.I. (1987). Issues in designing sequential stopping rules for monitoring side effects in clinical trials. Controlled Clinical Trials 8(4), 327-37.
Ivanova, A., Qaqish, B.F. and Schell, M.J. (2005). Continuous toxicity monitoring in phase II trials in oncology. Biometrics 61(2), 540-545.
Kulldorff, M., Davis, R.L., Kolczak, M., Lewis, E., Lieu, T. and Platt, R. (2011). A maximized sequential probability ratio test for drug and vaccine safety surveillance. Sequential Analysis 30(1), 58-78.
Martens, M.J. and Logan, B.R. (2024). Statistical Rules for Safety Monitoring in Clinical Trials. Clinical Trials 21(2), 152-161.
Pocock, S.J. (1977). Group sequential methods in the design and analysis of clinical trials. Biometrika 64(2), 191-199.
Wang, S.K. and Tsiatis, A.A. (1987). Approximately optimal one-parameter boundaries for group sequential trials. Biometrics 193-199.
# Binomial Pocock test in 50 patient cohort at 10% level, expected toxicity # probability of 20% calc.rule.bin(ns=1:50,p0=0.20,alpha=0.10,type="Pocock") # Binomial Wang-Tsiatis test with Delta = 0.25 in 50 patient cohort at 10% level, # expected toxicity probability of 20% calc.rule.bin(ns=1:50,p0=0.20,alpha=0.10,type="WT",param=0.25) # Beta-binomial test of Geller et al. 2003 with hyperparameters (1, 9) in 100 # patient cohort at 5% level, expected toxicity probability of 10% calc.rule.bin(ns=1:100,p0=0.10,alpha=0.05,type="BB",param=c(1,9)) # Binomial truncated SPRT with p1 = 0.3 in 100 patient cohort at 5% level, # expected toxicity probability of 10% calc.rule.bin(ns=1:100,p0=0.10,alpha=0.05,type="SPRT",param=0.3)
# Binomial Pocock test in 50 patient cohort at 10% level, expected toxicity # probability of 20% calc.rule.bin(ns=1:50,p0=0.20,alpha=0.10,type="Pocock") # Binomial Wang-Tsiatis test with Delta = 0.25 in 50 patient cohort at 10% level, # expected toxicity probability of 20% calc.rule.bin(ns=1:50,p0=0.20,alpha=0.10,type="WT",param=0.25) # Beta-binomial test of Geller et al. 2003 with hyperparameters (1, 9) in 100 # patient cohort at 5% level, expected toxicity probability of 10% calc.rule.bin(ns=1:100,p0=0.10,alpha=0.05,type="BB",param=c(1,9)) # Binomial truncated SPRT with p1 = 0.3 in 100 patient cohort at 5% level, # expected toxicity probability of 10% calc.rule.bin(ns=1:100,p0=0.10,alpha=0.05,type="SPRT",param=0.3)
Calculate a stopping rule for safety monitoring for time-to-event data
calc.rule.surv(n, p0, alpha, type, tau, maxInf = "expected", param = NULL)
calc.rule.surv(n, p0, alpha, type, tau, maxInf = "expected", param = NULL)
n |
Maximum sample size for safety monitoring |
p0 |
The probability of a toxicity occurring in |
alpha |
The nominal type I error/false positive rate for the stopping rule, under an assumption that the cumulative number of events follows a Poisson process over the study duration. |
type |
The method used for constructing the stopping rule. Choices including a Pocock test ("Pocock"), a O'Brein-Fleming test ("OBF"), a Wang-Tsiatis test ("WT"), the Bayesian Gamma-Poisson method ("GP"), a truncated sequential probability ratio test ("SPRT"), and a maximized SPRT ("MaxSPRT") |
tau |
Length of observation period |
maxInf |
Specification of the maximum information (maximum exposure time) used for designing the stopping rule. Options include the expected exposure time for n patients used H0 ("expected") and the maximum possible exposure time ("maximum"). Default is "expected" (expected exposure time in cohort). |
param |
A vector of the extra parameter(s) needed for certain stopping rule methods. For Wang-Tsiatis tests, this is the Delta parameter. For truncated SPRT, this is the targeted alternative toxicity probability p1. For Bayesian Gamma-Poisson model, this is the vector of hyperparameters (shape,rate) for the gamma prior on the toxicity event rate. |
A rule.surv object, which is a list with the following elements: Rule, a two-column matrix with total follow-up times for each stage and their corresponding rejection boundaries; n
; p0
; alpha
; type
; tau
; param
; and cval, the boundary parameter for the rule
Kulldorff, M., Davis, R. L., Kolczak, M., Lewis, E., Lieu, T., and Platt, R. (2011). A maximized sequential probability ratio test for drug and vaccine safety surveillance. Sequential Analysis, 30(1), 58–78.
Zacks, S. and Mukhopadhyay, N. (2006). Exact risks of sequential point estimators of the exponential parameter. Sequential Analysis, 25(2), 203–226.
# Survival Pocock test in 50 patient cohort at 10% level, expected toxicity # probability of 20%, 100 day observation period calc.rule.surv(n=50,p0=0.20,alpha=0.10,type="Pocock",tau=100) # Survival Wang-Tsiatis test with Delta = 0.25 in 50 patient cohort at 10% level, # expected toxicity probability of 20%, 100 day observation period calc.rule.surv(n=50,p0=0.20,alpha=0.10,type="WT",tau=100,param=0.25) # Gamma-Poisson test with hyperparameters (1, 1000) in 100 patient cohort at 5% level, # expected toxicity probability of 10%, 60 day observation period calc.rule.surv(n=100,p0=0.10,alpha=0.05,type="GP",tau=60,param=c(1,1000)) # Truncated exponential SPRT with p1 = 0.3 in 100 patient cohort at 5% level, # expected toxicity probability of 10%, 60 day observation period calc.rule.surv(n=100,p0=0.10,alpha=0.05,type="SPRT",tau=60,param=0.3)
# Survival Pocock test in 50 patient cohort at 10% level, expected toxicity # probability of 20%, 100 day observation period calc.rule.surv(n=50,p0=0.20,alpha=0.10,type="Pocock",tau=100) # Survival Wang-Tsiatis test with Delta = 0.25 in 50 patient cohort at 10% level, # expected toxicity probability of 20%, 100 day observation period calc.rule.surv(n=50,p0=0.20,alpha=0.10,type="WT",tau=100,param=0.25) # Gamma-Poisson test with hyperparameters (1, 1000) in 100 patient cohort at 5% level, # expected toxicity probability of 10%, 60 day observation period calc.rule.surv(n=100,p0=0.10,alpha=0.05,type="GP",tau=60,param=c(1,1000)) # Truncated exponential SPRT with p1 = 0.3 in 100 patient cohort at 5% level, # expected toxicity probability of 10%, 60 day observation period calc.rule.surv(n=100,p0=0.10,alpha=0.05,type="SPRT",tau=60,param=0.3)
Internal workhorse function to calculate the calibration constant value that attains level alpha for given method
findconst.bin(ns, p0, alpha, type, l, u, iter = 50, param)
findconst.bin(ns, p0, alpha, type, l, u, iter = 50, param)
ns |
A vector of sample sizes at which sequential testing is performed |
p0 |
The toxicity probability under the null hypothesis |
alpha |
The desired type I error / false positive rate for the stopping rule |
type |
The method used for constructing the stopping rule |
l |
Lower starting value of bracket for calibration constant |
u |
Upper starting value of bracket for calibration constant |
iter |
The number of iterations used to search for the boundary |
param |
A vector of the extra parameter(s) needed for certain stopping rule methods. For binomial Wang-Tsiatis tests, this is the Delta parameter. For the Geller et al. method, this is the vector of hyperparameters (a,b) for the beta prior on the toxicity probability. For Chen and Chaloner's method, this is the vector (a,b,p1,nu), containing the hyperparameters (a,b) for the beta prior on the toxicity probability, the targeted alternative toxicity probability p1, and the threshold nu for the posterior probability that the true toxicity probability p > p1. For truncated SPRT, this is the targeted alternative toxicity probability p1. |
The calibration constant used for subsequent stopping boundary calculation
Internal workhorse function to calculate the calibration constant value that attains level alpha for given method for time-to-event data
findconst.surv(n, p0, alpha, type, tau, maxInf = "expected", param = NULL)
findconst.surv(n, p0, alpha, type, tau, maxInf = "expected", param = NULL)
n |
Maximum sample size for safety monitoring |
p0 |
The probability of a toxicity occurring in |
alpha |
The nominal type I error/false positive rate for the stopping rule, under an assumption that the cumulative number of events follows a Poisson process over the study duration. |
type |
The method used for constructing the stopping rule |
tau |
Length of observation period |
maxInf |
Specification of the maximum information (maximum exposure time) used for designing the stopping rule. Options include the expected exposure time for n patients used H0 ("expected") and the maximum possible exposure time ("maximum"). Default is "expected" (expected exposure time in cohort). |
param |
A vector of the extra parameter(s) needed for certain stopping rule methods. For Wang-Tsiatis tests, this is the Delta parameter. For truncated SPRT, this is the targeted alternative toxicity probability p1. For Bayesian Gamma-Poisson model, this is the vector of hyperparameters (shape,rate) for the gamma prior on the toxicity event rate. |
The calibration constant used for subsequent stopping boundary calculation
Add a binary stopping rule graphically as a curve on current plot
## S3 method for class 'rule.bin' lines(x, smooth = TRUE, ...)
## S3 method for class 'rule.bin' lines(x, smooth = TRUE, ...)
x |
A |
smooth |
Binary indicator of whether stopping rule boundary should be smoothed by linear interpolation between evaluation points |
... |
Other options to be passed to generic |
No return value; function solely modifies current plot
# Binomial Pocock test in 50 patient cohort at 10% level, expected toxicity probability of 20% poc_rule = calc.rule.bin(ns=1:50,p0=0.20,alpha=0.10,type="Pocock") # Bayesian beta-binomial method of Geller et al. in 50 patient cohort at 10% level, # expected toxicity probability of 20% bb_rule = calc.rule.bin(ns=1:50,p0=0.20,alpha=0.10,type="BB",param=c(2,8)) # Plot stopping boundaries for stopping rules plot(poc_rule,col="blue") lines(bb_rule,col="red")
# Binomial Pocock test in 50 patient cohort at 10% level, expected toxicity probability of 20% poc_rule = calc.rule.bin(ns=1:50,p0=0.20,alpha=0.10,type="Pocock") # Bayesian beta-binomial method of Geller et al. in 50 patient cohort at 10% level, # expected toxicity probability of 20% bb_rule = calc.rule.bin(ns=1:50,p0=0.20,alpha=0.10,type="BB",param=c(2,8)) # Plot stopping boundaries for stopping rules plot(poc_rule,col="blue") lines(bb_rule,col="red")
Add a survival stopping rule graphically as a curve on current plot for time-to-event data
## S3 method for class 'rule.surv' lines(x, ...)
## S3 method for class 'rule.surv' lines(x, ...)
x |
A |
... |
Other options to be passed to generic |
No return value, function solely modifies current plot
poc_rule = calc.rule.surv(n=50,p0=0.20,alpha=0.10,type="Pocock",tau=100) gp_rule = calc.rule.surv(n=50,p0=0.20,alpha=0.10,type="GP",tau=100,param=c(1,1000)) plot(poc_rule) lines(gp_rule,col="red")
poc_rule = calc.rule.surv(n=50,p0=0.20,alpha=0.10,type="Pocock",tau=100) gp_rule = calc.rule.surv(n=50,p0=0.20,alpha=0.10,type="GP",tau=100,param=c(1,1000)) plot(poc_rule) lines(gp_rule,col="red")
A wrapper function to compute operating characteristics for a stopping rule at a set of toxicity rates.
OC.rule(data.type, ...)
OC.rule(data.type, ...)
data.type |
Type of data, choices include 'bin' for binary data and 'surv' for time-to-event data |
... |
Other options to be passed to the corresponding operating characteristics calculation. Please refer to the corresponding |
Please refer to the corresponding data type-specific OC.rule()
function for more details
bb_rule = calc.rule(data.type="bin",ns=1:50,p0=0.20,alpha=0.10,type="BB",param=c(2,8)) gp_rule = calc.rule(data.type="surv",n=50,p0=0.20,alpha=0.10,type="GP",tau=60,param=c(1,1000)) OC.rule(data.type="bin",rule=bb_rule,ps=seq(0.1, 0.5, 0.1)) OC.rule(data.type="bin",rule=bb_rule,ps=seq(0.1, 0.5, 0.1),tau=60,A=730) OC.rule(data.type="surv",rule=gp_rule,ps=seq(0.1, 0.5, 0.1),MC=1000, A=730)
bb_rule = calc.rule(data.type="bin",ns=1:50,p0=0.20,alpha=0.10,type="BB",param=c(2,8)) gp_rule = calc.rule(data.type="surv",n=50,p0=0.20,alpha=0.10,type="GP",tau=60,param=c(1,1000)) OC.rule(data.type="bin",rule=bb_rule,ps=seq(0.1, 0.5, 0.1)) OC.rule(data.type="bin",rule=bb_rule,ps=seq(0.1, 0.5, 0.1),tau=60,A=730) OC.rule(data.type="surv",rule=gp_rule,ps=seq(0.1, 0.5, 0.1),MC=1000, A=730)
Compute operating characteristics for a stopping rule at a set of toxicity rates. Characteristics calculated include the overall rejection probability, the expected number of patients evaluated, and the expected number of events.
OC.rule.bin(rule, ps, tau = NULL, A = NULL)
OC.rule.bin(rule, ps, tau = NULL, A = NULL)
rule |
A |
ps |
A vector of toxicity probabilities at which the operating characteristics will be computed |
tau |
Length of observation period |
A |
Length of the enrollment period |
If tau
and A
are specified, the expected number of events includes events among patients who are still pending evaluation at the time of early stopping, computed under an assumption of a random uniform accrual distribution. Otherwise, only events that occurred prior to stopping are included, as the number of events occurring in pending patients depends on tau
and A
.
A matrix with columns containing the toxicity probabilities ps
, the corresponding rejection probabilities, and the corresponding expected number of events. If tau
and A
are also specified, the expected numbers of enrolled patients and the expected calendar time at the point of stopping/study end are also included.
# Binomial Pocock test in 50 patient cohort at 10% level, expected toxicity probability of 20% poc_rule = calc.rule.bin(ns=1:50,p0=0.20,alpha=0.10,type="Pocock") # Bayesian beta-binomial method of Geller et al. in 50 patient cohort at 10% level, # expected toxicity probability of 20% bb_rule = calc.rule.bin(ns=1:50,p0=0.20,alpha=0.10,type="BB",param=c(2,8)) # Compute operating characteristics at toxicity probabilities of 20%, 25%, 30%, 35%, and 40% OC.rule.bin(rule=poc_rule,ps=seq(0.2,0.4,0.05)) OC.rule.bin(rule=bb_rule,ps=seq(0.2,0.4,0.05),tau=30,A=730)
# Binomial Pocock test in 50 patient cohort at 10% level, expected toxicity probability of 20% poc_rule = calc.rule.bin(ns=1:50,p0=0.20,alpha=0.10,type="Pocock") # Bayesian beta-binomial method of Geller et al. in 50 patient cohort at 10% level, # expected toxicity probability of 20% bb_rule = calc.rule.bin(ns=1:50,p0=0.20,alpha=0.10,type="BB",param=c(2,8)) # Compute operating characteristics at toxicity probabilities of 20%, 25%, 30%, 35%, and 40% OC.rule.bin(rule=poc_rule,ps=seq(0.2,0.4,0.05)) OC.rule.bin(rule=bb_rule,ps=seq(0.2,0.4,0.05),tau=30,A=730)
Compute operating characteristics for a stopping rule at a set of toxicity rates. Characteristics calculated include the overall rejection probability, the expected number of patients evaluated, and the expected number of events for time-to-event data.
OC.rule.surv(rule, ps, MC, A, s = 1)
OC.rule.surv(rule, ps, MC, A, s = 1)
rule |
A |
ps |
A vector of toxicity probabilities at which the operating characteristics will be computed |
MC |
Number of Monte Carlo replicates to simulate for estimating operating characteristics. If |
A |
Length of the enrollment period. Only required if |
s |
Shape parameter for the Weibull distribution used to simulate event times. Default is |
Operating characteristics are generated either by Monte Carlo estimation or computed
directly under a Poisson process assumption for the event process over time. The
Monte Carlo approach assumes a random uniform accrual distribution and a Weibull
event time distribution with distribution function , so
it requires specification of the enrollment period length and shape parameter
of the event distribution.
A matrix with columns containing the toxicity probabilities ps
,
the corresponding rejection probabilities, and the corresponding expected number
of events. If MC
is not NULL, the expected number of enrolled patients
and expected calendar time at the point of stopping/study end are also included.
poc_rule = calc.rule.surv(n=50,p0=0.20,alpha=0.10,type="Pocock",tau=100) gp_rule = calc.rule.surv(n=50,p0=0.20,alpha=0.10,type="GP",tau=60,param=c(1,1000)) OC.rule.surv(rule=poc_rule,ps=seq(0.2,0.4,0.05),MC=0) OC.rule.surv(rule=gp_rule,ps=seq(0.2,0.4,0.05),MC=0) set.seed(82426499) ps = seq(0.15,0.35,0.05) wt_rule = calc.rule.surv(n=46,p0=0.15,alpha=0.10,type="WT",tau=100,param=0.25) OC.rule.surv(rule=wt_rule,ps=ps,MC=1000,A=1095) p1h = 0.3418071 sp_rule = calc.rule.surv(n=46,p0=0.15,alpha=0.10,type="SPRT",tau=100,param=p1h) OC.rule.surv(rule=sp_rule,ps=ps,MC=1000,A=1095) gp_rule = calc.rule.surv(n=46,p0=0.15,alpha=0.10,type="GP",tau=100, param=11.5*c(-log(1-0.15),100)) OC.rule.surv(rule=gp_rule,ps=ps,MC=1000,A=1095)
poc_rule = calc.rule.surv(n=50,p0=0.20,alpha=0.10,type="Pocock",tau=100) gp_rule = calc.rule.surv(n=50,p0=0.20,alpha=0.10,type="GP",tau=60,param=c(1,1000)) OC.rule.surv(rule=poc_rule,ps=seq(0.2,0.4,0.05),MC=0) OC.rule.surv(rule=gp_rule,ps=seq(0.2,0.4,0.05),MC=0) set.seed(82426499) ps = seq(0.15,0.35,0.05) wt_rule = calc.rule.surv(n=46,p0=0.15,alpha=0.10,type="WT",tau=100,param=0.25) OC.rule.surv(rule=wt_rule,ps=ps,MC=1000,A=1095) p1h = 0.3418071 sp_rule = calc.rule.surv(n=46,p0=0.15,alpha=0.10,type="SPRT",tau=100,param=p1h) OC.rule.surv(rule=sp_rule,ps=ps,MC=1000,A=1095) gp_rule = calc.rule.surv(n=46,p0=0.15,alpha=0.10,type="GP",tau=100, param=11.5*c(-log(1-0.15),100)) OC.rule.surv(rule=gp_rule,ps=ps,MC=1000,A=1095)
Internal workhorse function to calculate operating characteristics for a given stopping rule and toxicity probability
opchars.bin(rule, p, tau = NULL, A = NULL)
opchars.bin(rule, p, tau = NULL, A = NULL)
rule |
A |
p |
The toxicity probability |
tau |
Length of observation period |
A |
Length of the enrollment period. |
A list containing the toxicity probability p
, and the corresponding rejection probability and expected number of events. If tau
and A
are also specified, the expected number of enrolled patients and the expected calendar time at the point of stopping/study end are also included.
Internal workhorse function to calculate operating characteristics for a given stopping rule and toxicity probability
opchars.surv(rule, p, MC, A, s = 1)
opchars.surv(rule, p, MC, A, s = 1)
rule |
A |
p |
The toxicity probability |
MC |
Number of Monte Carlo replicates to simulate for estimating operating characteristics. If |
A |
Length of the enrollment period. Only required if |
s |
Shape parameter for the Weibull distribution used to simulate event times. Only required if |
A list containing the rejection probability p
, and the corresponding
rejection probability and number of events. If MC
is not NULL, the expected
number of enrolled patients and total follow up time are also included.
Display a stopping rule graphically as a curve
## S3 method for class 'rule.bin' plot( x, smooth = TRUE, xlim = c(0, max(x$ns)), ylim = c(0, max(x$Rule[, 2]) + 1), xlab = "# Evaluable", ylab = "# Events", ... )
## S3 method for class 'rule.bin' plot( x, smooth = TRUE, xlim = c(0, max(x$ns)), ylim = c(0, max(x$Rule[, 2]) + 1), xlab = "# Evaluable", ylab = "# Events", ... )
x |
A |
smooth |
Binary indicator of whether stopping rule boundary should be smoothed by linear interpolation between evaluation points |
xlim |
The x limits (x1, x2) of the plot. Note that x1 > x2 is allowed and leads to a ‘reversed axis’. |
ylim |
The y limits of the plot. |
xlab |
The title for the x axis |
ylab |
The title for the y axis |
... |
Other options to be passed to generic |
No return value; function solely generates a plot
# Binomial Pocock test in 50 patient cohort at 10% level, expected toxicity probability of 20% poc_rule = calc.rule.bin(ns=1:50,p0=0.20,alpha=0.10,type="Pocock") # Bayesian beta-binomial method of Geller et al. in 50 patient cohort at 10% level, # expected toxicity probability of 20% bb_rule = calc.rule.bin(ns=1:50,p0=0.20,alpha=0.10,type="BB",param=c(2,8)) # Plot stopping boundary with smoothing plot(poc_rule,col="blue") lines(bb_rule,col="red")
# Binomial Pocock test in 50 patient cohort at 10% level, expected toxicity probability of 20% poc_rule = calc.rule.bin(ns=1:50,p0=0.20,alpha=0.10,type="Pocock") # Bayesian beta-binomial method of Geller et al. in 50 patient cohort at 10% level, # expected toxicity probability of 20% bb_rule = calc.rule.bin(ns=1:50,p0=0.20,alpha=0.10,type="BB",param=c(2,8)) # Plot stopping boundary with smoothing plot(poc_rule,col="blue") lines(bb_rule,col="red")
Display a stopping rule graphically as a curve for time-to-event data
## S3 method for class 'rule.surv' plot( x, xlim = c(0, max(x$Rule[, 1])), ylim = c(0, max(x$Rule[, 2]) + 1), xlab = "Total Exposure Time", ylab = "# Events", ... )
## S3 method for class 'rule.surv' plot( x, xlim = c(0, max(x$Rule[, 1])), ylim = c(0, max(x$Rule[, 2]) + 1), xlab = "Total Exposure Time", ylab = "# Events", ... )
x |
A |
xlim |
The x limits (x1, x2) of the plot. Note that x1 > x2 is allowed and leads to a ‘reversed axis’. |
ylim |
The y limits of the plot. |
xlab |
The title for the x axis |
ylab |
The title for the y axis |
... |
Other parameters passed to the |
No return value; function solely generates a plot
poc_rule = calc.rule.surv(n=50,p0=0.20,alpha=0.10,type="Pocock",tau=100) gp_rule = calc.rule.surv(n=50,p0=0.20,alpha=0.10,type="GP",tau=100,param=c(1,1000)) plot(poc_rule) lines(gp_rule,col="red")
poc_rule = calc.rule.surv(n=50,p0=0.20,alpha=0.10,type="Pocock",tau=100) gp_rule = calc.rule.surv(n=50,p0=0.20,alpha=0.10,type="GP",tau=100,param=c(1,1000)) plot(poc_rule) lines(gp_rule,col="red")
Internal function to simulate survival data from Weibull distribution for evaluating safety
monitoring rules. A random sample of size n
is generated from a Weibull
distribution with shape parameter s
to attain a toxicity rate of p
at
survival time tau
. Enrollment times are also simulated over an accrual period
of duration A
under a uniform (0,A
) distribution.
simdata_weibull(n, p, tau, A, s = 1)
simdata_weibull(n, p, tau, A, s = 1)
n |
Maximum sample size for safety monitoring |
p |
The probability of a toxicity occurring in |
tau |
Length of observation period |
A |
Length of accrual period |
s |
Shape parameter for the Weibull distribution; default value is 1 (exponential distribution) |
A matrix with two columns: patient enrollment time and event time
Internal workhorse function used to simulate trials with safety monitoring by
survival data stopping rules. The provided stopping rule
is used for
monitoring of MC
simulated trials. For each trial, a random sample is
generated from a Weibull distribution with shape parameter s
to attain
a toxicity rate of p
. Enrollment times are simulated over an accrual
period of duration A
under a uniform (0,A
) distribution.
simtrials.surv(rule, p, MC, A, s = 1)
simtrials.surv(rule, p, MC, A, s = 1)
rule |
A |
p |
The probability of a toxicity occurring in |
MC |
Number of Monte Carlo replicated datasets to simulate |
A |
Length of accrual period |
s |
Shape parameter for the Weibull distribution; default value is 1 (exponential distribution) |
A matrix with MC
rows and 14 columns, one row per simulated
trial. Columns include the stopping rule type and design parameters,
the numbers of events and enrolled patients, the total follow-up time
in the cohort, the calendar time when the study ends, the reject/no reject
decision, and the last stage of monitoring reached when the study ends.
set.seed(13) wt_rule = calc.rule.surv(n=46,p0=0.15,alpha=0.10,type="WT",tau=100,param=0.25) sims = simtrials.surv(rule=wt_rule,p=0.15,MC=1000,A=1095) c(mean(sims$stopped),mean(sims$n.Toxicity),mean(sims$n.Enrolled),mean(sims$Calendar.Time)) sims = simtrials.surv(rule=wt_rule,p=0.35,MC=1000,A=1095) c(mean(sims$stopped),mean(sims$n.Toxicity),mean(sims$n.Enrolled),mean(sims$Calendar.Time)) gp_rule = calc.rule.surv(n=46,p0=0.15,alpha=0.10,type="GP",tau=100,param=11.5*c(-log(1-0.15),100)) sims = simtrials.surv(rule=gp_rule,p=0.15,MC=1000,A=1095) c(mean(sims$stopped),mean(sims$n.Toxicity),mean(sims$n.Enrolled),mean(sims$Calendar.Time)) sims = simtrials.surv(rule=gp_rule,p=0.35,MC=1000,A=1095) c(mean(sims$stopped),mean(sims$n.Toxicity),mean(sims$n.Enrolled),mean(sims$Calendar.Time))
set.seed(13) wt_rule = calc.rule.surv(n=46,p0=0.15,alpha=0.10,type="WT",tau=100,param=0.25) sims = simtrials.surv(rule=wt_rule,p=0.15,MC=1000,A=1095) c(mean(sims$stopped),mean(sims$n.Toxicity),mean(sims$n.Enrolled),mean(sims$Calendar.Time)) sims = simtrials.surv(rule=wt_rule,p=0.35,MC=1000,A=1095) c(mean(sims$stopped),mean(sims$n.Toxicity),mean(sims$n.Enrolled),mean(sims$Calendar.Time)) gp_rule = calc.rule.surv(n=46,p0=0.15,alpha=0.10,type="GP",tau=100,param=11.5*c(-log(1-0.15),100)) sims = simtrials.surv(rule=gp_rule,p=0.15,MC=1000,A=1095) c(mean(sims$stopped),mean(sims$n.Toxicity),mean(sims$n.Enrolled),mean(sims$Calendar.Time)) sims = simtrials.surv(rule=gp_rule,p=0.35,MC=1000,A=1095) c(mean(sims$stopped),mean(sims$n.Toxicity),mean(sims$n.Enrolled),mean(sims$Calendar.Time))
Internal workhouse function to calculate the stopping probability given a rejection boundary for time-to-event data
stopping.prob.surv(bnd, p)
stopping.prob.surv(bnd, p)
bnd |
A list object calculated by |
p |
True toxicity probability |
A list of three: stopping probabilities at each stage, total stopping probability, and non-stopping probabilities of each possible number of events at the last stage.
Provides functions for creating, displaying, and evaluating stopping rules for safety monitoring in clinical studies.
Michael J. Martens [email protected]
Summarize a stopping rule in a condensed tabular format
table.rule.bin(x)
table.rule.bin(x)
x |
A |
A matrix with two columns: the ranges of evaluable patients, and corresponding rejection boundaries for these ranges
# Binomial Pocock test in 50 patient cohort at 10% level, expected toxicity probability of 20% poc_rule = calc.rule.bin(ns=1:50,p0=0.20,alpha=0.10,type="Pocock") # Tabulate stopping boundary table.rule.bin(poc_rule)
# Binomial Pocock test in 50 patient cohort at 10% level, expected toxicity probability of 20% poc_rule = calc.rule.bin(ns=1:50,p0=0.20,alpha=0.10,type="Pocock") # Tabulate stopping boundary table.rule.bin(poc_rule)
Summarize a stopping rule in a condensed tabular format
table.rule.surv(rule, dec = 0)
table.rule.surv(rule, dec = 0)
rule |
A |
dec |
Number of decimal places to which the stagewise total follow-up times should be rounded |
A matrix with two columns: total follow up time and their corresponding rejection boundary
gp_rule = calc.rule.surv(n=50,p0=0.20,alpha=0.10,type="GP",tau=100,param=c(1,1000)) table.rule.surv(gp_rule,2)
gp_rule = calc.rule.surv(n=50,p0=0.20,alpha=0.10,type="GP",tau=100,param=c(1,1000)) table.rule.surv(gp_rule,2)