| Title: | Bayesian Decision-Making for Clinical Trials |
|---|---|
| Description: | Provides tools for Bayesian decision-making in single-arm phase II clinical trials with binary efficacy endpoints. Uses Beta-binomial models to calculate posterior probabilities that the response rate exceeds a prespecified reference value and to estimate predictive probabilities of meeting final-analysis success criteria. Evaluates the frequentist operating characteristics of two-stage designs with posterior-probability-based stopping rules, including type I error rates, statistical power, and probabilities of early stopping for efficacy or futility, using Monte Carlo simulation. For methodological background, see Thall and Simon (1994) <doi:10.2307/2533377> and Lee and Liu (2008) <doi:10.1177/1740774508089279>. |
| Authors: | Jiangyan Zhao [cre, aut], Rongji Mu [aut, cph] |
| Maintainer: | Jiangyan Zhao <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 0.1.0 |
| Built: | 2026-11-19 13:38:36 UTC |
| Source: | https://github.com/cran/BayesianTrial |
Evaluates the operating characteristics of a two-stage single-arm phase II trial with a binary efficacy endpoint and prespecified posterior-probability stopping rules. Monte Carlo simulation is used to estimate the probability of trial success and early stopping probabilities for efficacy and futility.
oc_singlearm_binary( theta_true, n_current, N_total, alpha0 = 0.2, beta0 = 0.8, theta0_null = 0.2, gamma_early = 0.98, gamma_futility = 0.5, gamma_final = 0.95, ntrial = 10000, seed = 666 )oc_singlearm_binary( theta_true, n_current, N_total, alpha0 = 0.2, beta0 = 0.8, theta0_null = 0.2, gamma_early = 0.98, gamma_futility = 0.5, gamma_final = 0.95, ntrial = 10000, seed = 666 )
theta_true |
Assumed true treatment response rate for generating trial outcomes; a probability between 0 and 1. Specify the null-scenario rate to assess the type I error rate or a clinically promising alternative rate to assess power. |
n_current |
Planned number of patients with evaluable outcomes at the single interim
analysis; a non-negative integer not exceeding |
N_total |
Planned maximum number of evaluable patients; a non-negative integer at
least as large as |
alpha0, beta0
|
Positive, finite shape parameters of the Beta prior for the response rate. Their sum must also be finite. |
theta0_null |
Prespecified unacceptable or historical reference response rate used as the primary efficacy benchmark; a probability between 0 and 1. |
gamma_early |
Interim posterior probability cutoff for early declaration of efficacy; a
probability between 0 and 1. An early positive result is
declared if the posterior probability of exceeding |
gamma_futility |
Interim posterior probability cutoff for stopping due to futility; a
probability between 0 and 1 and strictly less than
|
gamma_final |
Posterior probability cutoff for declaring a positive result at the final analysis if the trial continues; a probability between 0 and 1. |
ntrial |
Positive integer number of independently simulated trials. |
seed |
Optional integer seed for reproducibility. |
A named list containing:
Estimated overall probability of declaring a positive trial result, including early efficacy stopping. Interpreted as type I error probability under a null scenario or as power under a specified alternative.
Estimated probability of stopping the trial at the interim analysis for futility.
Estimated probability of stopping the trial at the interim analysis for efficacy.
Zhao, J., and Mu, R. (2026). Introduction to Bayesian Decision Method and Its Application in Medical Research. Manuscript in preparation (in Chinese).
Thall, P. F., and Simon, R. M. (1994). Practical Bayesian guidelines for phase IIB clinical trials. Biometrics, 50, 337–349. doi:10.2307/2533377.
Lee, J. J., and Liu, D. D. (2008). A predictive probability design for phase II cancer clinical trials. Clinical Trials, 5, 93–106. doi:10.1177/1740774508089279.
posterior_predictive_singlearm_binary
null_oc <- oc_singlearm_binary( theta_true = 0.20, n_current = 20, N_total = 40 ) alternative_oc <- oc_singlearm_binary( theta_true = 0.40, n_current = 20, N_total = 40 ) null_oc$power_null_post # Type I error probability at the null rate alternative_oc$power_null_post # Power at the alternative ratenull_oc <- oc_singlearm_binary( theta_true = 0.20, n_current = 20, N_total = 40 ) alternative_oc <- oc_singlearm_binary( theta_true = 0.40, n_current = 20, N_total = 40 ) null_oc$power_null_post # Type I error probability at the null rate alternative_oc$power_null_post # Power at the alternative rate
Calculates posterior summaries of the treatment response rate and predictive probabilities of meeting prespecified final-analysis efficacy criteria in single-arm phase II trials with binary endpoints.
posterior_predictive_singlearm_binary( x_obs, n_current, N_total, alpha0 = 0.2, beta0 = 0.8, theta0_null = 0.2, theta0_clin = 0.4, gamma_final = 0.95, gamma_clin_final = 0.9, S = 10000, type = c("posterior", "predictive", "both"), seed = 666 )posterior_predictive_singlearm_binary( x_obs, n_current, N_total, alpha0 = 0.2, beta0 = 0.8, theta0_null = 0.2, theta0_clin = 0.4, gamma_final = 0.95, gamma_clin_final = 0.9, S = 10000, type = c("posterior", "predictive", "both"), seed = 666 )
x_obs |
Number of observed responses among |
n_current |
Number of patients with evaluable outcomes at the
current analysis; a non-negative integer no greater than |
N_total |
Planned maximum number of patients with evaluable outcomes;
a non-negative integer at least as large as |
alpha0, beta0
|
Positive shape parameters of the Beta prior for the response rate. |
theta0_null |
Prespecified historical reference or unacceptable response rate; a probability between 0 and 1. |
theta0_clin |
Clinically meaningful target response rate for a supplementary predictive assessment; a probability between 0 and 1. |
gamma_final |
Final posterior probability threshold for trial success
relative to |
gamma_clin_final |
Final posterior probability threshold for the
supplementary criterion relative to |
S |
Positive integer number of Monte Carlo replications used to estimate predictive probabilities. |
type |
Results to return: |
seed |
Optional integer seed for reproducibility. |
A named list containing the components specified by type.
The default returns posterior summaries; "predictive" returns
predictive probabilities; "both" returns all components:
Shape parameters alpha and beta of the
current Beta posterior.
Posterior mean of the response rate.
Posterior standard deviation of the response rate.
Posterior probability that the response rate exceeds
theta0_null.
Predictive probability of meeting the final efficacy
criterion defined by theta0_null and gamma_final.
Predictive probability of meeting the supplementary
criterion defined by theta0_clin and gamma_clin_final.
Predictive probabilities are estimated by Monte Carlo simulation,
conditional on the observed data and completion of the planned
sample size N_total.
Zhao, J., and Mu, R. (2026). Introduction to Bayesian Decision Method and Its Application in Medical Research. Manuscript in preparation (in Chinese).
Thall, P. F., and Simon, R. M. (1994). Practical Bayesian guidelines for phase IIB clinical trials. Biometrics, 50, 337–349. doi:10.2307/2533377.
Lee, J. J., and Liu, D. D. (2008). A predictive probability design for phase II cancer clinical trials. Clinical Trials, 5, 93–106. doi:10.1177/1740774508089279.
posterior <- posterior_predictive_singlearm_binary( x_obs = 9, n_current = 20, N_total = 40 ) posterior$p_null predictive <- posterior_predictive_singlearm_binary( x_obs = 9, n_current = 20, N_total = 40, type = "predictive" ) predictive$ppos_null both <- posterior_predictive_singlearm_binary( x_obs = 9, n_current = 20, N_total = 40, type = "both" ) bothposterior <- posterior_predictive_singlearm_binary( x_obs = 9, n_current = 20, N_total = 40 ) posterior$p_null predictive <- posterior_predictive_singlearm_binary( x_obs = 9, n_current = 20, N_total = 40, type = "predictive" ) predictive$ppos_null both <- posterior_predictive_singlearm_binary( x_obs = 9, n_current = 20, N_total = 40, type = "both" ) both