Package 'stoppingrule'

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

Help Index


Stopping Rule Boundary Function

Description

A wrapper function to calculate the boundary for a given stopping rule for safety monitoring for time-to-event data or binary data

Usage

bdryfcn(data.type, ...)

Arguments

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 bdryfcn() function for more details

Value

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)


Stopping Rule Boundary Function (Binary Data)

Description

Calculate the boundary for a given stopping rule

Usage

bdryfcn.bin(n, p0, type, cval, param = NULL)

Arguments

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.

Value

A univariate function that defines the rejection boundary at any number of evaluable patients


Stopping Rule Boundary Function (Survival Data)

Description

Calculate the boundary for a given stopping rule

Usage

bdryfcn.surv(n, p0, type, tau, cval, param = NULL)

Arguments

n

Maximum sample size for safety monitoring

p0

The probability of a toxicity occurring in tau units of time under the null hypothesis

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.

Value

A univariate function that defines the rejection boundary at any amount of total follow-up time


Stopping Boundary Calculation (Binary Data)

Description

Internal workhorse function to calculate stopping boundary for a given method, treating toxicities as binary data

Usage

calc.bnd.bin(n, p0, type, cval, param)

Arguments

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.

Value

A vector of stopping boundaries at the sample sizes 1, 2, ..., n


Stopping Boundary Calculation (Survival Data)

Description

Internal workhorse function to calculate stopping boundary for a given method for time-to-event data

Usage

calc.bnd.surv(n, p0, type, tau, cval, maxInf = "expected", param = NULL)

Arguments

n

maximum sample size for safety monitoring

p0

The probability of a toxicity occurring in tau units of time under the null hypothesis

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.

Value

A list of three items: tau, number of events that can trigger a stop, and the corresponding total follow up time.


Stopping Rule Calculation

Description

A wrapper function to calculate a stopping rule for safety monitoring for time-to-event data or binary data

Usage

calc.rule(data.type, ...)

Arguments

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 calc.rule() function for more details

Value

Please refer to the corresponding data type-specific calc.rule() function for details on its output

Examples

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)

Stopping Rule Calculation (Binary Data)

Description

Calculate a stopping rule for safety monitoring, treating toxicities as binary data

Usage

calc.rule.bin(ns, p0, alpha, type, param = NULL, iter = 50)

Arguments

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

Value

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

References

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.

Examples

# 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)

Stopping Rule Calculation (Survival Data)

Description

Calculate a stopping rule for safety monitoring for time-to-event data

Usage

calc.rule.surv(n, p0, alpha, type, tau, maxInf = "expected", param = NULL)

Arguments

n

Maximum sample size for safety monitoring

p0

The probability of a toxicity occurring in tau units of time under the null hypothesis

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.

Value

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

References

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.

Examples

# 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)

Search for Calibration Value (Binary Data)

Description

Internal workhorse function to calculate the calibration constant value that attains level alpha for given method

Usage

findconst.bin(ns, p0, alpha, type, l, u, iter = 50, param)

Arguments

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.

Value

The calibration constant used for subsequent stopping boundary calculation


Search for Calibration Value (Survival Data)

Description

Internal workhorse function to calculate the calibration constant value that attains level alpha for given method for time-to-event data

Usage

findconst.surv(n, p0, alpha, type, tau, maxInf = "expected", param = NULL)

Arguments

n

Maximum sample size for safety monitoring

p0

The probability of a toxicity occurring in tau units of time under the null hypothesis

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.

Value

The calibration constant used for subsequent stopping boundary calculation


Add Stopping Rule Curve to Current Plot (Binary Data)

Description

Add a binary stopping rule graphically as a curve on current plot

Usage

## S3 method for class 'rule.bin'
lines(x, smooth = TRUE, ...)

Arguments

x

A rule.bin object calculated by calc.rule.bin() function

smooth

Binary indicator of whether stopping rule boundary should be smoothed by linear interpolation between evaluation points

...

Other options to be passed to generic lines function

Value

No return value; function solely modifies current plot

Examples

# 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 Stopping Rule Curve to Current Plot (Survival Data)

Description

Add a survival stopping rule graphically as a curve on current plot for time-to-event data

Usage

## S3 method for class 'rule.surv'
lines(x, ...)

Arguments

x

A rule.surv object calculated by calc.rule.surv() function

...

Other options to be passed to generic lines() function

Value

No return value, function solely modifies current plot

Examples

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")

Operating Characteristics Function

Description

A wrapper function to compute operating characteristics for a stopping rule at a set of toxicity rates.

Usage

OC.rule(data.type, ...)

Arguments

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 OC.rule() function for more details

Value

Please refer to the corresponding data type-specific OC.rule() function for more details

Examples

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)

Operating Characteristics Function (Binary Data)

Description

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.

Usage

OC.rule.bin(rule, ps, tau = NULL, A = NULL)

Arguments

rule

A rule.bin object calculated by calc.rule.bin() function

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

Details

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.

Value

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.

Examples

# 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)

Operating Characteristics Function (Survival Data)

Description

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.

Usage

OC.rule.surv(rule, ps, MC, A, s = 1)

Arguments

rule

A rule.surv object calculated by calc.rule.surv() function

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 MC = 0, a Poisson process assumption on the event process is used to compute operating characteristics.

A

Length of the enrollment period. Only required if MC > 0.

s

Shape parameter for the Weibull distribution used to simulate event times. Default is s = 1 (exponential). Only required if MC > 0.

Details

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 exp(λts)exp(-\lambda * t^s), so it requires specification of the enrollment period length and shape parameter of the event distribution.

Value

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.

Examples

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)

Operating Characteristics Function (Binary Data)

Description

Internal workhorse function to calculate operating characteristics for a given stopping rule and toxicity probability

Usage

opchars.bin(rule, p, tau = NULL, A = NULL)

Arguments

rule

A rule.bin object calculated by calc.rule.bin() function

p

The toxicity probability

tau

Length of observation period

A

Length of the enrollment period.

Value

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.


Operating Characteristics Function (Survival Data)

Description

Internal workhorse function to calculate operating characteristics for a given stopping rule and toxicity probability

Usage

opchars.surv(rule, p, MC, A, s = 1)

Arguments

rule

A rule.surv object calculated by calc.rule.surv() function

p

The toxicity probability

MC

Number of Monte Carlo replicates to simulate for estimating operating characteristics. If MC = 0, a Poisson process assumption on the event process is used to compute operating characteristics.

A

Length of the enrollment period. Only required if MC > 0.

s

Shape parameter for the Weibull distribution used to simulate event times. Only required if MC > 0.

Value

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.


Plot Stopping Rule (Binary Data)

Description

Display a stopping rule graphically as a curve

Usage

## 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",
  ...
)

Arguments

x

A rule.bin object calculated by calc.rule.bin() function

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 plot function

Value

No return value; function solely generates a plot

Examples

# 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")

Plot Stopping Rule (Survival Data)

Description

Display a stopping rule graphically as a curve for time-to-event data

Usage

## 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",
  ...
)

Arguments

x

A rule.surv object calculated by calc.rule.surv() function

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 plot function.

Value

No return value; function solely generates a plot

Examples

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")

Simulate survival data for safety monitoring under Weibull distribution

Description

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.

Usage

simdata_weibull(n, p, tau, A, s = 1)

Arguments

n

Maximum sample size for safety monitoring

p

The probability of a toxicity occurring in tau units of time under the null hypothesis

tau

Length of observation period

A

Length of accrual period

s

Shape parameter for the Weibull distribution; default value is 1 (exponential distribution)

Value

A matrix with two columns: patient enrollment time and event time


Simulate trials with safety monitoring by survival data stopping rules

Description

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.

Usage

simtrials.surv(rule, p, MC, A, s = 1)

Arguments

rule

A rule.surv object with the safety stopping rule for evaluation

p

The probability of a toxicity occurring in tau units of time under the null hypothesis

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)

Value

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.

Examples

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))

Calculating the stopping probability given a rejection boundary (Survival Data)

Description

Internal workhouse function to calculate the stopping probability given a rejection boundary for time-to-event data

Usage

stopping.prob.surv(bnd, p)

Arguments

bnd

A list object calculated by calc.bnd.surv function

p

True toxicity probability

Value

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.


Create and Evaluate Stopping Rules for Safety Monitoring

Description

Provides functions for creating, displaying, and evaluating stopping rules for safety monitoring in clinical studies.

Author(s)

Michael J. Martens [email protected]


Tabulate Stopping Rule (Binary Data)

Description

Summarize a stopping rule in a condensed tabular format

Usage

table.rule.bin(x)

Arguments

x

A rule.bin object calculated by calc.rule.bin() function

Value

A matrix with two columns: the ranges of evaluable patients, and corresponding rejection boundaries for these ranges

Examples

# 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)

Tabulate Stopping Rule (Survival data)

Description

Summarize a stopping rule in a condensed tabular format

Usage

table.rule.surv(rule, dec = 0)

Arguments

rule

A rule.surv object calculated by calc.rule.surv() function

dec

Number of decimal places to which the stagewise total follow-up times should be rounded

Value

A matrix with two columns: total follow up time and their corresponding rejection boundary

Examples

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)