Package: bbssr 3.0.0

bbssr: Blinded Sample Size Re-Estimation for Binary Endpoints

Tools for blinded sample size re-estimation (BSSR) in two-arm clinical trials with binary endpoints, together with the exact power and sample size calculations that the re-estimation relies on, for two independent groups, for matched pairs and for stratified designs. For two independent groups seven statistical tests are implemented: Pearson chi-squared, Fisher exact, Fisher mid-p, Z-pooled exact unconditional, the exact unconditional test of Boschloo (1970) <doi:10.1111/j.1467-9574.1970.tb00104.x>, and the tests of non-inferiority and equivalence of Blackwelder (1982) <doi:10.1016/0197-2456(82)90024-1> and of Farrington and Manning (1990) <doi:10.1002/sim.4780091208>, with a margin on the scale of the risk difference or the risk ratio. Each test is available with a one-sided or a two-sided alternative, and the exact unconditional tests can be combined with the Berger-Boos procedure. For matched pairs the McNemar tests and the score test of Nam (1997) <doi:10.2307/2533508> are implemented, and for stratified designs the Cochran-Mantel-Haenszel test, Cochran's test with the sample size formulas of Woolson et al. (1986) <doi:10.2307/2530706> and Nam (1992) <doi:10.2307/2532298>, and the stratified exact conditional test of Jung (2014) <doi:10.1002/bimj.201300048>. The power, the distribution of the final sample size and the type I error rate of a re-estimation design are computed exactly, by simulation for three or more strata and as averages over simulated allocation sequences for random stratum and group sizes, the significance level can be adjusted so that the type I error rate is controlled, and the sample size can be re-estimated from the blinded data of a trial that is under way. Statistical methods based on Mehrotra et al. (2003) <doi:10.1111/1541-0420.00051>, Berger and Boos (1994) <doi:10.1080/01621459.1994.10476836>, Friede and Kieser (2004) <doi:10.1002/pst.140>, Friede et al. (2007) <doi:10.1002/bimj.200610373> and Kieser (2020) <doi:10.1007/978-3-030-49528-2_21>.

Authors:Gosuke Homma [aut, cre]

bbssr_3.0.0.tar.gz
bbssr_3.0.0.zip(r-4.7-x86_64)bbssr_3.0.0.zip(r-4.7-arm64)bbssr_3.0.0.zip(r-4.6-x86_64)bbssr_3.0.0.zip(r-4.6-arm64)bbssr_3.0.0.zip(r-4.5-x86_64)
bbssr_3.0.0.tgz(r-4.6-x86_64)bbssr_3.0.0.tgz(r-4.6-arm64)bbssr_3.0.0.tgz(r-4.5-x86_64)bbssr_3.0.0.tgz(r-4.5-arm64)
bbssr_3.0.0.tar.gz(r-4.7-arm64)bbssr_3.0.0.tar.gz(r-4.7-x86_64)bbssr_3.0.0.tar.gz(r-4.6-arm64)bbssr_3.0.0.tar.gz(r-4.6-x86_64)
bbssr_3.0.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
bbssr/json (API)

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

Bug tracker:https://github.com/gosukehommaex/bbssr/issues

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

Uses libs:
  • c++– GNU Standard C++ Library v3

On CRAN:

Conda:

binary-endpointsclinical-trialspower-calculationsample-size-calculationcpp

6.25 score 2 stars 27 scripts 281 downloads 25 exports 19 dependencies

Last updated from:976931545a. Checks:15 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-arm64OK200
linux-devel-x86_64OK237
source / vignettesOK324
linux-release-arm64OK197
linux-release-x86_64OK257
macos-release-arm64OK497
macos-release-x86_64OK475
macos-oldrel-arm64OK219
macos-oldrel-x86_64OK322
windows-devel-arm64OK330
windows-devel-x86_64OK267
windows-release-arm64OK329
windows-release-x86_64OK206
windows-oldrel-x86_64OK212
wasm-releaseOK127

Exports:BinaryAlphaAdjBSSRBinaryBSSRBinaryCondRejectBSSRBinaryGridBSSRBinaryPowerBinaryPowerBSSRBinaryRRBinarySampleSizeBinaryTypeIErrorBSSRPairedAlphaAdjBSSRPairedBSSRPairedPowerPairedPowerBSSRPairedRRPairedSampleSizePairedTypeIErrorBSSRStratAlphaAdjBSSRStratBSSRStratCondRejectBSSRStratGridBSSRStratPowerStratPowerBSSRStratRRStratSampleSizeStratTypeIErrorBSSR

Dependencies:clicpp11farverfpCompareggplot2gluegtableisobandlabelinglifecycleR6RColorBrewerRcpprlangS7scalesvctrsviridisLitewithr

Introduction to bbssr
What the package does | The seven tests | Rejection regions | Power and sample size | Blinded sample size re-estimation | Restricted and unrestricted rules | Re-estimating from observed interim data | Two-sided tests | Type I error rate of a re-estimation design | Where to go next | References

Last update: 2026-10-27
Started: 2025-06-13

Paired Binary Data
Design and notation | Tests | Power and number of pairs | Blinded sample size re-estimation | Type I error rate | Non-inferiority and equivalence | References

Last update: 2026-10-27
Started: 2026-10-23

Stratified Designs
Design and notation | Tests | Power and sample size | Blinded sample size re-estimation | Type I error rate | Analyses that ignore the strata | Random stratum and group sizes | Several designs | Three or more strata | References

Last update: 2026-10-27
Started: 2026-10-23

Validation by Reproducing Published Figures
Purpose | Friede and Kieser (2004) | Figure 1 (p. 272) | Figure 2 (p. 273) | Figure 3 (p. 274) | Figure 4 (p. 277) | Kieser (2020), Chapter 21 | Figure 21.1 (p. 229) | Figure 21.2 (p. 231) | Figure 21.3 (p. 233) | Figure 21.4 (p. 234) | Kieser (2020), Chapter 23 | Figure 23.1 (p. 251) | Figure 23.2 (p. 252) | Figure 23.3 (p. 252) | Friede, Mitchell and Mueller-Velten (2007) | Figure 1 (p. 908) | Figure 2 (p. 909) | Figure 3 (p. 911) | Boschloo (1970) | Figure 2 (p. 3) | Berger and Sidik (2003) | Figure 2 (p. 105) | Fagerland, Lydersen and Laake (2013) | Figure 1 (p. 4) | Figure 2 (p. 6) | Schepers et al. (2026) | Figure 1 (p. 5) | Agreement of the stored values with the package | References

Last update: 2026-10-26
Started: 2026-10-08

Validation of bbssr
Conditional tests against stats | Unconditional tests against a direct evaluation | Why the tie handling matters | Comparison with the Exact package | Comparison with exact2x2 | Type I error rate of every test | Speed | Sample size search | Re-estimation designs | Reproduction of published results | Summary | References

Last update: 2026-10-26
Started: 2025-06-14

Re-estimating the Sample Size from Interim Data
Two questions, two functions | Planning | Evaluating the re-estimation rule | The interim analysis | What the decision looks like across interim outcomes | Truncation at the boundary | Unequal allocation | Practical notes

Last update: 2026-10-24
Started: 2026-08-13

Statistical Methods in bbssr
Notation | Conditional tests | Two-sided conventions | Unconditional tests | Refining the maximum between the grid points | Ties in the ordering statistic | The Berger-Boos procedure | Relationships between the tests | Blinded sample size re-estimation | The largest type I error rate | Choosing a test | References

Last update: 2026-10-24
Started: 2025-06-13

Type I Error Rate of a Re-estimation Design
The type I error rate of a re-estimation design | The rate over the nuisance parameter | Exact tests in the final analysis | The adjusted significance level | Control within a confidence interval | Conditional rejection probabilities | Non-inferiority | References

Last update: 2026-10-24
Started: 2026-10-05

Non-inferiority and Equivalence Trials
Hypotheses and margin | The two tests | Sample size | Blinded sample size re-estimation | Type I error rate on the boundary | Margin on the scale of the risk ratio | Tests of equivalence | References

Last update: 2026-10-23
Started: 2026-10-05

Options of the Sample Size Re-estimation
A reference design | Exact power or the normal approximation | Another test or level for the re-estimation | Whole numbers | Bounds on the final sample size | Interim sample sizes | Risk ratio and odds ratio | Distribution of the final sample size | References

Last update: 2026-10-07
Started: 2026-10-05

Comparing Designs with BinaryGridBSSR
One data frame for many designs | Summaries and plots | Initial sample sizes from a planning proportion | Designs specified in different ways | A true effect other than the assumed one

Last update: 2026-10-06
Started: 2026-10-05

Readme and manuals

Help Manual

Help pageTopics
Adjusted Significance Level of a Blinded Sample Size Re-estimation DesignBinaryAlphaAdjBSSR
Sample Size Re-estimation from Observed Blinded Interim DataBinaryBSSR
Conditional Rejection Probabilities of a Blinded Sample Size Re-estimation DesignBinaryCondRejectBSSR
Power and Sample Size of Several Blinded Sample Size Re-estimation DesignsBinaryGridBSSR
Power Calculation for Two-Arm Trials with Binary EndpointsBinaryPower
Power of a Blinded Sample Size Re-estimation Design for Binary EndpointsBinaryPowerBSSR
Rejection Region for Two-Arm Trials with Binary EndpointsBinaryRR
Sample Size Calculation for Two-Arm Trials with Binary EndpointsBinarySampleSize
Type I Error Rate of a Blinded Sample Size Re-estimation DesignBinaryTypeIErrorBSSR
Adjusted Significance Level of Blinded Sample Size Re-Estimation for Paired Binary DataPairedAlphaAdjBSSR
Blinded Sample Size Re-Estimation from Paired Interim DataPairedBSSR
Power for Paired Binary DataPairedPower
Power of Blinded Sample Size Re-Estimation for Paired Binary DataPairedPowerBSSR
Rejection Region for Paired Binary DataPairedRR
Sample Size for Paired Binary DataPairedSampleSize
Type I Error Rate of Blinded Sample Size Re-Estimation for Paired Binary DataPairedTypeIErrorBSSR
Plot Method for bbssr_crp Objectsplot.bbssr_crp
Plot Method for bbssr_grid Objectsplot.bbssr_grid
Plot Exact Power against the Response Probability of Group 1plot.bbssr_power
Plot the Power of a BSSR Design against the Fixed-Sample Designplot.bbssr_powerbssr
Plot a Rejection Region for Paired Binary Dataplot.bbssr_prr
Plot Method for bbssr_ptie Objectsplot.bbssr_ptie
Plot a Rejection Regionplot.bbssr_rr
Plot the Exact Power Curve around a Sample Size Solutionplot.bbssr_samplesize
Plot Method for bbssr_sgrid Objectsplot.bbssr_sgrid
Plot the Power of a Stratified BSSR Design against the Fixed Designplot.bbssr_spowerbssr
Plot Method for bbssr_stie Objectsplot.bbssr_stie
Plot Method for bbssr_tie Objectsplot.bbssr_tie
Print Method for bbssr_alphaadj Objectsprint.bbssr_alphaadj
Print a Sample Size Re-estimation from Interim Dataprint.bbssr_bssr
Print Method for bbssr_crp Objectsprint.bbssr_crp
Print Method for bbssr_pbssr Objectsprint.bbssr_pbssr
Print Exact Power Resultsprint.bbssr_power
Print the Operating Characteristics of a BSSR Designprint.bbssr_powerbssr
Print Method for bbssr_ppower Objectsprint.bbssr_ppower
Print Method for bbssr_ppowerbssr Objectsprint.bbssr_ppowerbssr
Print Method for bbssr_prr Objectsprint.bbssr_prr
Print Method for bbssr_psamplesize Objectsprint.bbssr_psamplesize
Print Method for bbssr_ptie Objectsprint.bbssr_ptie
Print a Rejection Regionprint.bbssr_rr
Print a Sample Size Calculationprint.bbssr_samplesize
Print Method for bbssr_sbssr Objectsprint.bbssr_sbssr
Print Method for bbssr_scrp Objectsprint.bbssr_scrp
Print Method for bbssr_spower Objectsprint.bbssr_spower
Print Method for bbssr_spowerbssr Objectsprint.bbssr_spowerbssr
Print Method for bbssr_srr Objectsprint.bbssr_srr
Print Method for bbssr_ssamplesize Objectsprint.bbssr_ssamplesize
Print Method for bbssr_stie Objectsprint.bbssr_stie
Print Method for bbssr_tie Objectsprint.bbssr_tie
Adjusted Significance Level of Blinded Sample Size Re-Estimation for a Stratified DesignStratAlphaAdjBSSR
Blinded Sample Size Re-Estimation for a Stratified TrialStratBSSR
Conditional Rejection Probabilities of Blinded Sample Size Re-Estimation for a Stratified DesignStratCondRejectBSSR
Power and Sample Size of Several Stratified Re-estimation DesignsStratGridBSSR
Exact Power of a Stratified TestStratPower
Power of Blinded Sample Size Re-Estimation for a Stratified DesignStratPowerBSSR
Rejection Region of a Stratified TestStratRR
Sample Size of a Stratified TestStratSampleSize
Type I Error Rate of Blinded Sample Size Re-Estimation for a Stratified DesignStratTypeIErrorBSSR
Summary Method for bbssr_grid Objectssummary.bbssr_grid
Summary Method for bbssr_powerbssr Objectssummary.bbssr_powerbssr
Summary Method for bbssr_spowerbssr Objectssummary.bbssr_spowerbssr