Package: bfbin2arm 0.1.7

Riko Kelter

bfbin2arm: Bayes Factor Design for Two-Arm Binomial Trials

Design and analysis of one- and two-stage phase II clinical trials using Bayes factors. Implements methods for binomial and continuous endpoints, including point-null and directional hypotheses, power calculations, and sample size calibration. Supports one-arm trials with a single treatment arm and two-arm trials with treatment and control arms. Includes methods for equivalence, non-inferiority, and superiority designs.

Authors:Riko Kelter [aut, cre]

bfbin2arm_0.1.7.tar.gz
bfbin2arm_0.1.7.zip(r-4.7-any)bfbin2arm_0.1.7.zip(r-4.6-any)bfbin2arm_0.1.7.zip(r-4.5-any)
bfbin2arm_0.1.7.tgz(r-4.6-any)bfbin2arm_0.1.7.tgz(r-4.5-any)
bfbin2arm_0.1.7.tar.gz(r-4.7-any)bfbin2arm_0.1.7.tar.gz(r-4.6-any)
bfbin2arm_0.1.7.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION
card.svg |card.png
bfbin2arm/json (API)

# Install 'bfbin2arm' in R:
install.packages('bfbin2arm', repos = c('https://rikokelter.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/rikokelter/bfbin2arm/issues

Pkgdown/docs site:https://rikokelter.github.io

On CRAN:

Conda:

4.83 score 15 scripts 539 downloads 45 exports 29 dependencies

Last updated from:e18c77d297. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-develOK159
source / vignettesOK325
linux-releaseOK126
macos-releaseOK232
macos-oldrelOK224
windows-develOK132
windows-releaseOK127
windows-oldrelOK101
wasm-releaseOK101

Exports:BFminus0BFminus1BFplus0BFplus1BFplusMinuscalibrate_bf_ttestcheck_feasibility_ropedesign_singlearm_bfdesign_singlearm_onestage_bfdesign_singlearm_onestage_ropedesign_singlearm_twostage_ropedesign_singlearm_twostage_rope_equivdesign_singlearm_twostage_rope_nidesign_singlearm_twostage_rope_supdesign_twoarm_onestage_bfdesign_twoarm_onestage_ropedesign_twoarm_onestage_rope_directionaldesign_twoarm_onestage_rope_nidesign_twoarm_onestage_rope_nisupdesign_twoarm_onestage_rope_supdesign_twoarm_twostage_bfmake_analysis_prior_greatermake_analysis_prior_less_equalmake_analysis_prior_two_sidedmake_design_prior_normalmake_design_prior_pointmake_point_priormake_priorntwoarmbinbf01optimal_twostage_2arm_bfoptimal_twostage_singlearm_bfplot_twostage_2arm_bfpostProbHminuspostProbHpluspowerbinbf01_fixedpowerbinbf01seqpowertwoarmbinbf01predictiveDensityH0predictiveDensityH1predictiveDensityHminus_truncpredictiveDensityHplus_truncpriorProbHminuspriorProbHplustwoarmbinbf_plus0_directtwoarmbinbf01

Dependencies:clicpp11dplyrfarvergenericsggplot2gluegridExtragtableisobandlabelinglifecyclemagrittrpatchworkpillarpkgconfigR6RColorBrewerrlangS7scalesstatmodtibbletidyselectutf8vctrsVGAMviridisLitewithr

Bayesian calibration of two-arm one-stage Bayes factor designs with binary endpoints
Introduction and Overview | Hypothesis tests | Design and analysis priors | Using the package | ICT-107 Phase II Trial Overview | 1. Bayes Factor Analysis | 2. Operating characteristics for actual sample sizes | 3. Power and sample size planning | 4. Informative design priors | 5. Unequal randomization probabilities | 6. Design Recommendations based on the calibration | Summary | References

Last update: 2026-10-28
Started: 2026-06-23

Calibrated Bayesian One-Sample and Paired t-Tests for Continuous Endpoints in Clinical Trials
Overview | Example 1: Two-sided point-null design | A brief comparison of calibration modes | Frequentist calibration | Bayesian calibration | Hybrid calibration | Full calibration | Example 2: Directional point-null design | Full calibration without PCE | Example 3: Directional composite-null design | Comparison with a conventional frequentist design | Example 4: Paired one-sample design | Paired outcome and hypothesis | [D_i | X_ | Priors, evidence thresholds, and calibration targets | [\pi_ | N(-0.10,0.25^2)\big| | Calibrated design | Interpretation and relation to the one-sample example | [\sigma_D^2 | \sigma_{\mathrm{baseline}}^2+\sigma_{\mathrm{follow\text{-}up}}^2 | Interpretation | References

Last update: 2026-10-28
Started: 2026-10-28

Clinical trial designs in bfbin2arm
Introduction | Bayes factors in single-arm phase II designs | Types of priors | Calibration modes | Vignette overview | Single-arm designs | Two-arm designs | References

Last update: 2026-10-28
Started: 2026-06-23

Optimal hybrid calibration for single-arm two-stage Bayes factor designs with binary endpoints
Hybrid calibration: Overview | Basics of hybrid calibration | Finding an optimal hybrid design | Interpretation of hybrid calibration | Bayesian and frequentist expected sample sizes | Frequentist expected sample size | Bayesian expected sample size | Sensitivity to the $H_1$ design prior | Adding a compelling-evidence constraint under $H_0$ | Power cushions in hybrid calibration | Interpretation of the power_cushion parameter | Practical guidance | Practical recommendations for hybrid calibration | References

Last update: 2026-07-07
Started: 2026-06-23

Calibration of Bayesian one-stage designs for single-arm phase II trials with binary endpoints
Introduction | How to design a Bayesian trial: Overview of the calibration algorithm | Basic calibration | Operating-characteristic curves | Adding a constraint on the probability of compelling evidence | Full Bayes-frequentist calibration | Frequentist calibration | Hybrid calibration | Relationship to the two-stage design | Summary | References

Last update: 2026-07-06
Started: 2026-06-23

Optimal Bayesian calibration for single-arm two-stage Bayes factor designs
Introduction | Hypotheses and thresholds | Priors and calibration inputs | Analysis prior | Bayesian design prior | Frequentist point alternative | Interpretation of Bayesian and frequentist power | Bayesian power | Frequentist power | The function design_singlearm_bf() | Overview of the calibration algorithm | Interpretation of the corrected operating characteristics | Detailed example: Nonsmall cell lung cancer phase II trial | Optimal design search | Printing and summarizing the result | Accessing and plotting the results | Example with a constraint on compelling evidence for the null hypothesis | Summary | References

Last update: 2026-06-23
Started: 2026-06-23

Optimal Bayesian calibration of two-arm two-stage Bayes factor designs with binary endpoints
Introduction | Hypotheses and Bayes factors | Priors: design vs analysis | Design priors | Analysis priors | Overview of the calibration algorithm | Riociguat phase II trial: fixed-sample design and optimal two-stage design | The two-stage design function design_twoarm_twostage_bf() | Riociguat phase II trial: Setup | Riociguat phase II trial: Fixed-sample comparator via design_twoarm_onestage_bf() | Riociguat phase II trial: Optimal Bayesian two-stage design via design_twoarm_twostage_bf() | Interpretation of the small futility probability | A note on the expected sample size | Reducing the expected sample size substantially | One-stage design | Two-stage design without power cushion | Interpretation of the conv flag | How priors and thresholds affect the calibration grid (and runtime) | Design priors and required sample size | Evidence threshold $k$ and required sample size | Probability of compelling evidence for $H_0$ and feasibility | Practical recommendation for vignettes and examples | Summary | References

Last update: 2026-06-23
Started: 2026-06-23

Optimal frequentist calibration for single-arm two-stage Bayes factor designs with binary endpoints
Introduction | Frequentist calibration: overview | Manual evaluation of a two-stage design | Optimal frequentist design | Interpreting the frequentist design | Practical recommendations for frequentist calibration | References

Last update: 2026-06-23
Started: 2026-06-23

Optimal full calibration for single-arm two-stage Bayes factor designs with binary endpoints
Introduction: Hybrid and full calibration | Bayesian calibration | Hybrid Bayes-frequentist calibration | Current implementation | Full Bayesian and frequentist calibration | Overview of the different calibration modes | Full calibration example | Why the design is selected | Comparison of calibration modes | Practical recommendations for full calibration | References

Last update: 2026-06-23
Started: 2026-06-23

Readme and manuals

Help Manual

Help pageTopics
Check sustained feasibility over future n.sustained_singlearm_feasibility
Convert a one-stage single-arm BF design to a data frameas.data.frame.singlearm_onestage_bf_design
Convert candidates to a data frameas.data.frame.singlearm_rope_twostage_design
Bayes factor BF-0: H- vs H0BFminus0
Bayes factor BF-1: H- vs H1BFminus1
Bayes factor BF+0: H+ vs H0BFplus0
Bayes factor BF+1: H+ vs H1BFplus1
Bayes factor BF+-: H+ vs H-BFplusMinus
Calibrate a Bayesian t-test designcalibrate_bf_ttest
Check asymptotic feasibility of a ROPE-based designcheck_feasibility_rope
Extract design coefficientscoef.singlearm_rope_twostage_design
Design or evaluate a single-arm two-stage Bayes factor trialdesign_singlearm_bf
Design or evaluate a one-stage single-arm Bayes factor trialdesign_singlearm_onestage_bf
Calibrate a one-stage single-arm ROPE design for a binomial endpointdesign_singlearm_onestage_rope
Calibrate an optimal single-arm two-stage ROPE designdesign_singlearm_twostage_rope
Calibrate a two-stage ROPE equivalence designdesign_singlearm_twostage_rope_equiv
Calibrate a two-stage ROPE non-inferiority designdesign_singlearm_twostage_rope_ni
Calibrate a two-stage ROPE superiority designdesign_singlearm_twostage_rope_sup
Design or evaluate a one-stage two-arm Bayes factor trialdesign_twoarm_onestage_bf
Calibrate a one-stage two-arm ROPE equivalence design for binary endpointsdesign_twoarm_onestage_rope
Calibrate a one-stage two-arm directional ROPE design for binary endpointsdesign_twoarm_onestage_rope_directional
Calibrate a one-stage two-arm ROPE non-inferiority designdesign_twoarm_onestage_rope_ni
Calibrate a one-stage two-arm nested non-inferiority/superiority ROPE designdesign_twoarm_onestage_rope_nisup
Calibrate a one-stage two-arm ROPE superiority designdesign_twoarm_onestage_rope_sup
Design an optimal two-stage two-arm Bayes factor trialdesign_twoarm_twostage_bf
Create the default positive-direction analysis priormake_analysis_prior_greater
Create the default non-positive analysis priormake_analysis_prior_less_equal
Create the default two-sided analysis priormake_analysis_prior_two_sided
Create a zero-centred normal design-prior objectmake_design_prior_normal
Backward-compatible alias for 'make_point_prior()'make_design_prior_point
Point-mass prior at a fixed effectmake_point_prior
Create a prior for the standardized effectmake_prior
Sample size calibration for two-arm binomial Bayes factor designsntwoarmbinbf01
Internal calibration routine for one-stage single-arm BF designsoptimal_onestage_singlearm_bf
Internal calibration routine for one-stage two-arm BF designsoptimal_onestage_twoarm_bf
Optimal two-stage two-arm Bayes-factor design for binary endpointsoptimal_twostage_2arm_bf
Optimal two-stage single-arm Bayes factor designoptimal_twostage_singlearm_bf
Plot an optimal two-stage two-arm Bayes factor designplot_twostage_2arm_bf
Plot method for calibrated Bayesian t-test designsplot.bf_ttest_design
Plot a two-arm one-stage ROPE equivalence designplot.bfbin2armrope2armdesign
Plot a single-arm Bayes factor designplot.singlearm_bf_design
Plot a one-stage single-arm BF designplot.singlearm_onestage_bf_design
Plot a single-arm two-stage ROPE designplot.singlearm_rope_twostage_design
Plot a two-arm directional ROPE designplot.twoarm_rope_directional_onestage_design
Posterior probability P(p2 <= p1 | data)postProbHminus
Posterior probability P(p2 > p1 | data) under independent Beta priorspostProbHplus
Bayesian and frequentist operating characteristics for a fixed-sample single-arm BF designpowerbinbf01_fixed
Bayesian and frequentist operating characteristics for a single-arm two-stage BF designpowerbinbf01seq
Bayesian power, type-I error, and PCE(H0) for two-arm binomial Bayes factorspowertwoarmbinbf01
Predictive density under H0: p1 = p2 = ppredictiveDensityH0
Predictive density under H1: p1 != p2predictiveDensityH1
Predictive density under H-: p2 <= p1 (truncated prior)predictiveDensityHminus_trunc
Predictive density under H+: p2 > p1 (truncated prior)predictiveDensityHplus_trunc
Print method for one-stage single-arm BF designsprint.singlearm_onestage_bf_design
Print a single-arm two-stage ROPE designprint.singlearm_rope_twostage_design
Print method for summary.singlearm_bf_designprint.summary.singlearm_bf_design
Print method for summaries of one-stage single-arm BF designsprint.summary.singlearm_onestage_bf_design
Print a compact summary of a single-arm two-stage ROPE designprint.summary.singlearm_rope_twostage_design
Prior probability P(p2 <= p1) under independent Beta priorspriorProbHminus
Prior probability P(p2 > p1) under independent Beta priorspriorProbHplus
Summary for single-arm BF designssummary.singlearm_bf_design
Summarize a one-stage single-arm BF designsummary.singlearm_onestage_bf_design
Summary for a single-arm two-stage ROPE designsummary.singlearm_rope_twostage_design
Bayes factor BF+0 for the directional alternative vs point-nulltwoarmbinbf_plus0_direct
Two-arm binomial Bayes factor BF01twoarmbinbf01