| Title: | Partially Optimized Bayesian Phase II Efficacy and Futility Design |
|---|---|
| Description: | Implements a partially optimized Bayesian single-arm phase II design for a binary efficacy endpoint with efficacy and futility stopping. The design searches candidate response-count boundaries and, subject to prespecified error constraints, selects the design that minimizes the grey-zone at the final look. The package creates decision tables and evaluates operating characteristics by exact trial-path enumeration or Monte Carlo simulation. |
| Authors: | Feinan Lu [aut, cre] |
| Maintainer: | Feinan Lu <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.0 |
| Built: | 2026-11-17 15:34:36 UTC |
| Source: | https://github.com/cran/pob2ef |
Returns posterior evidence, probability boundaries, and the futility, superiority, continue, or final grey-zone action for every possible response count at each planned analysis.
decision_table(design)decision_table(design)
design |
A |
A data frame with one row per possible cumulative response count at each planned look.
design <- select_design( n_max = 20, looks = c(10, 20), p0 = 0.20, p1 = 0.40, alpha = 0.10, beta = 0.20, lambda1_grid = 0.50, lambda2_grid = 0.20, gamma_grid = 0, eta_grid = 0 ) decision_table(design)design <- select_design( n_max = 20, looks = c(10, 20), p0 = 0.20, p1 = 0.40, alpha = 0.10, beta = 0.20, lambda1_grid = 0.50, lambda2_grid = 0.20, gamma_grid = 0, eta_grid = 0 ) decision_table(design)
Displays every response-count action at each planned analysis as a filled grid. Interim continuation and final grey-zone outcomes are combined as the grey-zone display category.
plot_decision_boundaries(design, ...)plot_decision_boundaries(design, ...)
design |
A |
... |
Additional arguments passed to |
Invisibly returns the response-count decision table used for the figure.
design <- select_design( n_max = 20, looks = c(10, 20), p0 = 0.20, p1 = 0.40, alpha = 0.10, beta = 0.20, lambda1_grid = 0.50, lambda2_grid = 0.20, gamma_grid = 0, eta_grid = 0 ) plot_decision_boundaries(design)design <- select_design( n_max = 20, looks = c(10, 20), p0 = 0.20, p1 = 0.40, alpha = 0.10, beta = 0.20, lambda1_grid = 0.50, lambda2_grid = 0.20, gamma_grid = 0, eta_grid = 0 ) plot_decision_boundaries(design)
Plot simulated operating characteristics
plot_operating_characteristics( simulation, metric = "superiority_probability", ... )plot_operating_characteristics( simulation, metric = "superiority_probability", ... )
simulation |
A |
metric |
Operating characteristic to display. |
... |
Additional arguments passed to |
Invisibly returns the simulation results used for the figure.
design <- select_design( n_max = 20, looks = c(10, 20), p0 = 0.20, p1 = 0.40, alpha = 0.10, beta = 0.20, lambda1_grid = 0.50, lambda2_grid = 0.20, gamma_grid = 0, eta_grid = 0 ) simulation <- simulate_design( design, true_rates = c(0.20, 0.30, 0.40), n_sim = 100, seed = 2026 ) plot_operating_characteristics( simulation, metric = "superiority_probability" )design <- select_design( n_max = 20, looks = c(10, 20), p0 = 0.20, p1 = 0.40, alpha = 0.10, beta = 0.20, lambda1_grid = 0.50, lambda2_grid = 0.20, gamma_grid = 0, eta_grid = 0 ) simulation <- simulate_design( design, true_rates = c(0.20, 0.30, 0.40), n_sim = 100, seed = 2026 ) plot_operating_characteristics( simulation, metric = "superiority_probability" )
Searches a grid of boundary parameters and returns the feasible candidate that minimizes the final grey-zone probability at the desirable response rate subject to the prespecified error constraints.
select_design( n_max, looks, p0, p1, alpha, beta, prior = c(1, 1), lambda1_grid = seq(0.05, 0.5, by = 0.05), lambda2_grid = seq(0.05, 0.45, by = 0.05), gamma_grid = 0:3, eta_grid = 0:3 )select_design( n_max, looks, p0, p1, alpha, beta, prior = c(1, 1), lambda1_grid = seq(0.05, 0.5, by = 0.05), lambda2_grid = seq(0.05, 0.45, by = 0.05), gamma_grid = 0:3, eta_grid = 0:3 )
n_max |
Maximum evaluable sample size. |
looks |
Increasing planned analysis sample sizes ending at |
p0 |
Unacceptable response-rate benchmark. |
p1 |
Clinically desirable response-rate target, strictly greater than
|
alpha |
Maximum type I error, defined as superiority probability at
|
beta |
Maximum type II error, defined as futility probability at |
prior |
Two positive beta-prior shape parameters. |
lambda1_grid |
Candidate values for the futility boundary level. |
lambda2_grid |
Candidate values for the superiority boundary level. |
gamma_grid |
Candidate values for the futility boundary shape. |
eta_grid |
Candidate values for the superiority boundary shape. |
An object of class pob2ef_design containing the selected
parameters, operating characteristics, feasible candidates, and all
evaluated candidates.
design <- select_design( n_max = 20, looks = c(10, 20), p0 = 0.20, p1 = 0.40, alpha = 0.10, beta = 0.20, lambda1_grid = 0.50, lambda2_grid = 0.20, gamma_grid = 0, eta_grid = 0 ) design$selecteddesign <- select_design( n_max = 20, looks = c(10, 20), p0 = 0.20, p1 = 0.40, alpha = 0.10, beta = 0.20, lambda1_grid = 0.50, lambda2_grid = 0.20, gamma_grid = 0, eta_grid = 0 ) design$selected
Estimates operating characteristics by Monte Carlo simulation for one or more true response rates.
simulate_design(design, true_rates, n_sim = 10000L, seed = NULL)simulate_design(design, true_rates, n_sim = 10000L, seed = NULL)
design |
A |
true_rates |
True response rates to simulate. |
n_sim |
Number of simulated trials per true response rate. |
seed |
Optional integer random-number seed. |
An object of class pob2ef_simulation containing scenario-level
operating-characteristic estimates and Monte Carlo standard errors.
design <- select_design( n_max = 20, looks = c(10, 20), p0 = 0.20, p1 = 0.40, alpha = 0.10, beta = 0.20, lambda1_grid = 0.50, lambda2_grid = 0.20, gamma_grid = 0, eta_grid = 0 ) simulation <- simulate_design( design, true_rates = c(0.20, 0.30, 0.40), n_sim = 100, seed = 2026 ) simulation$resultsdesign <- select_design( n_max = 20, looks = c(10, 20), p0 = 0.20, p1 = 0.40, alpha = 0.10, beta = 0.20, lambda1_grid = 0.50, lambda2_grid = 0.20, gamma_grid = 0, eta_grid = 0 ) simulation <- simulate_design( design, true_rates = c(0.20, 0.30, 0.40), n_sim = 100, seed = 2026 ) simulation$results