Description
Bayesian Two-Stage Design with Window-Cohort and Controlled Roll-on for Time-to-Event Estimand.
Description
Calibrates Bayesian two-stage designs for single-arm phase II trials with time-to-event endpoints using a window-cohort with controlled roll-on. Interim monitoring is anchored to a locked interim cohort and a pre-specified follow-up requirement, so analysis timing remains predictable while preserving follow-up maturity. The package searches feasible interim rules, optimizes final sample size and decision thresholds, evaluates operating characteristics by Monte Carlo simulation, and supports exponential, Weibull, log-normal, log-logistic, and user-defined baseline survival models. Related published foundations include Simon (1989) <doi:10.1016/0197-2456(89)90015-9> and Cotterill and Whitehead (2015) <doi:10.1002/sim.6426>.
README.md
WCRBayesDesign
Bayesian Two-Stage Adaptive Design for Single-Arm Survival Trials
Overview
WCRBayesDesign provides simulation and optimization tools for Bayesian two-stage adaptive single-arm trials with time-to-event endpoints. All statistical calculations are carried out in a transformed-time space induced by a reference survival function $S_0$, while key results are reported on the original time scale for clinical interpretability.
Installation
# Install from source
install.packages("WCRBayesDesign_1.0.0.tar.gz", repos = NULL, type = "source")
Quick Start
library(WCRBayesDesign)
# Step 1 - Search feasible interim-analysis parameters
res_pIA <- find_Nw_pIA(
tau = 24, theta_L = 0.62, theta_alt = 0.80,
alpha_target = 0.05, beta_target = 0.20,
rate = 5/12, X_grid = c(1, 2, 3),
S0_dist = "weibull",
S0_par = list(k = 1.2, lambda = 0.08)
)
# Step 2 - Optimise the two-stage design
opt <- two_stage_optimize_design(
NwX_pIA_results = res_pIA,
rate = 5/12, tau = 24,
theta_L = 0.62, theta_alt = 0.80,
alpha_target = 0.05, beta_target = 0.20,
nsim = 2000,
S0_dist = "weibull",
S0_par = list(k = 1.2, lambda = 0.08),
optimize = "ESS", ncores = 4
)
# Step 3 - Evaluate operating characteristics
oc <- oc_two_stage(
N = 50, Nw = 30, X = 2,
pIA = 0.5, pF = 0.05,
rate = 5/12, tau = 24,
theta_L = 0.62, theta_alt = 0.80,
a0 = 0.01, b0 = 0.01, nsim = 5000,
S0_dist = "weibull",
S0_par = list(k = 1.2, lambda = 0.08)
)
Exported Functions
| Function | Purpose |
|---|---|
find_Nw_pIA() | Search for feasible interim-analysis parameters |
two_stage_optimize_design() | Optimise sample size and decision thresholds |
oc_two_stage() | Evaluate operating characteristics via simulation |
run_two_stage_trial() | Simulate a single two-stage trial |
conduct() | Perform Bayesian interim or final analysis |
S0_weibull() | Weibull reference survival function |
S0_inverse() | Inverse baseline survival function |
delta_from_theta_goal() | Convert survival-probability target to delta |
stats_transformed() | Compute transformed sufficient statistics |
Supported Baseline Distributions
- Exponential (
S0_dist = "exp") - Weibull (
S0_dist = "weibull") - Log-normal (
S0_dist = "lognormal") - Log-logistic (
S0_dist = "loglogistic") - User-supplied (
S0_dist = "custom")
License
GPL-3
Authors
- Zhongheng Cai (maintainer) — [email protected]
- Haitao Pan — [email protected].