# Example 1: Immunotherapy trial with delayed immune-related toxicity
# Scenario: CAR-T therapy with cytokine release syndrome and delayed efficacy
n.dose <- 4 # Four dose levels
start.dose <- 1
size.cohort <- 6 # Larger cohorts for immunotherapy
n.cohort <- 8 # Total: 48 patients
# CAR-T dose levels with delayed toxicity pattern
toxprob <- c(0.10, 0.25, 0.40, 0.55) # Including delayed immune toxicity
effprob <- c(0.20, 0.50, 0.70, 0.75) # Strong efficacy at higher doses
# Immunotherapy-appropriate targets
phi <- 0.35 # Higher toxicity tolerance
delta <- 0.60 # Target response rate
# Extended assessment windows for immune effects
tau.T <- 84 # 12 weeks for immune-related AEs
tau.E <- 112 # 16 weeks for response assessment
accrual <- 7 # Weekly enrollment
# Delayed toxicity/efficacy parameters
alpha.T1 <- 0.6 # Most toxicity in later period
alpha.E1 <- 0.7 # Most responses delayed
te.corr <- 0.3 # Moderate positive correlation
results_cart <- tite.boinet(
n.dose = n.dose, start.dose = start.dose,
size.cohort = size.cohort, n.cohort = n.cohort,
toxprob = toxprob, effprob = effprob,
phi = phi, delta = delta,
alpha.T1 = alpha.T1, alpha.E1 = alpha.E1,
tau.T = tau.T, tau.E = tau.E,
te.corr = te.corr, accrual = accrual,
estpt.method = "obs.prob", # Conservative for small sample
obd.method = "utility.weighted",
w1 = 0.4, w2 = 1.2, # Balanced approach with toxicity penalty
n.sim = 40
)
cat("Expected trial duration:", results_cart$duration, "days\\n")
cat("OBD selection probabilities:\\n")
print(results_cart$prop.select)
# Example 2: Targeted therapy with rapid accrual
# Scenario: Tyrosine kinase inhibitor with fast enrollment
n.dose <- 5
size.cohort <- 3
n.cohort <- 15 # 45 patients total
# Targeted therapy dose-response
toxprob <- c(0.05, 0.12, 0.22, 0.35, 0.52)
effprob <- c(0.15, 0.35, 0.55, 0.65, 0.60) # Plateau effect
phi <- 0.30
delta <- 0.50
# Shorter windows for targeted therapy
tau.T <- 28 # 4 weeks for acute toxicity
tau.E <- 56 # 8 weeks for response
accrual <- 3 # Very rapid accrual (every 3 days)
# More uniform timing
alpha.T1 <- 0.5
alpha.E1 <- 0.5
te.corr <- 0.1 # Weak correlation
results_tki <- tite.boinet(
n.dose = n.dose, start.dose = start.dose,
size.cohort = size.cohort, n.cohort = n.cohort,
toxprob = toxprob, effprob = effprob,
phi = phi, delta = delta,
alpha.T1 = alpha.T1, alpha.E1 = alpha.E1,
tau.T = tau.T, tau.E = tau.E,
te.corr = te.corr, accrual = accrual,
gen.event.time = "weibull",
gen.enroll.time = "exponential", # Variable enrollment
estpt.method = "fp.logistic", # Smooth modeling
obd.method = "max.effprob",
n.sim = 40
)
# Compare duration to standard BOIN-ET (hypothetical)
standard_duration <- tau.E + (n.cohort * size.cohort * accrual)
cat("TITE duration:", results_tki$duration, "days\\n")
cat("Standard BOIN-ET would take ~", standard_duration, "days\\n")
cat("Time savings:", standard_duration - results_tki$duration, "days\\n")
Run the code above in your browser using DataLab