Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.5%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

Basic Info
  • Host: GitHub
  • Owner: gosukehommaEX
  • License: other
  • Language: R
  • Default Branch: main
  • Size: 5.39 MB
Statistics
  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created about 1 year ago · Last pushed about 1 year ago
Metadata Files
Readme License

README.md

bbssr: Blinded Sample Size Re-estimation for Binary Endpoints

CRAN_Status_Badge R-CMD-check downloads downloads <!-- badges: end -->

Overview

bbssr is a comprehensive R package designed for blinded sample size re-estimation (BSSR) in two-arm clinical trials with binary endpoints. Unlike traditional fixed-sample designs, BSSR allows for adaptive sample size adjustments during the trial while maintaining the statistical integrity and blinding of the study.

Key Features

  • Blinded Sample Size Re-estimation: Implement adaptive trial designs that adjust sample sizes based on pooled data without unblinding treatment assignments
  • Multiple Exact Statistical Tests: Support for five different exact statistical tests optimized for binary endpoints
  • Flexible Design Options: Choose between restricted, unrestricted, and weighted BSSR approaches
  • Comprehensive Power Analysis: Calculate exact power for both traditional and BSSR designs
  • High-Performance Computing: Optimized algorithms deliver significant speed improvements over existing packages
  • Validated Accuracy: Extensive validation confirms identical results to established packages (Exact, exact2x2) across multiple scenarios

Statistical Methods Supported

The package implements five exact statistical tests specifically designed for binary endpoints in clinical trials:

  1. Pearson chi-squared test ('Chisq') - One-sided exact test
  2. Fisher exact test ('Fisher') - Classical exact conditional test
  3. Fisher mid-p test ('Fisher-midP') - Less conservative alternative to Fisher exact
  4. Z-pooled exact unconditional test ('Z-pool') - Unconditional exact test with pooled variance
  5. Boschloo exact unconditional test ('Boschloo') - Most powerful unconditional exact test

Why Use BSSR?

Traditional clinical trials with fixed sample sizes often suffer from: - Inefficient resource allocation when initial assumptions are incorrect - Underpowered studies due to overly optimistic effect size estimates - Ethical concerns about continuing underpowered or overpowered trials

BSSR addresses these issues by: - Maintaining statistical validity through exact methods - Preserving blinding by using only pooled response rates - Optimizing sample sizes based on observed data - Improving trial efficiency while controlling Type I error

Installation

Install the released version from CRAN:

r install.packages("bbssr")

Or install the development version from GitHub:

```r

install.packages("devtools")

devtools::install_github("gosukehommaEX/bbssr") ```

Quick Start

Basic Power Calculation

```r library(bbssr)

Calculate power for a traditional design

power_traditional <- BinaryPower( p1 = 0.5, # Response rate in treatment group p2 = 0.2, # Response rate in control group
N1 = 40, # Sample size in treatment group N2 = 40, # Sample size in control group alpha = 0.025, # One-sided significance level Test = 'Fisher' # Statistical test )

print(power_traditional) ```

Sample Size Calculation

```r

Calculate required sample size

sample_size <- BinarySampleSize( p1 = 0.5, # Expected response rate in treatment group p2 = 0.2, # Expected response rate in control group r = 1, # Allocation ratio (1:1) alpha = 0.025, # One-sided significance level tar.power = 0.8, # Target power Test = 'Boschloo' # Most powerful exact test )

print(sample_size) ```

Blinded Sample Size Re-estimation

```r library(dplyr)

BSSR with different design rules

bssr_result <- BinaryPowerBSSR( asmd.p1 = 0.45, # Assumed response rate in treatment group asmd.p2 = 0.09, # Assumed response rate in control group p = seq(0.1, 0.9, by = 0.1), # Range of pooled response rates Delta.A = 0.36, # Assumed treatment effect Delta.T = 0.36, # True treatment effect N1 = 24, # Initial sample size in treatment group N2 = 24, # Initial sample size in control group omega = 0.5, # Fraction for interim analysis r = 1, # Allocation ratio alpha = 0.025, # Significance level tar.power = 0.8, # Target power Test = 'Z-pool', # Statistical test restricted = FALSE, # Unrestricted design weighted = FALSE # Non-weighted approach )

head(bssr_result) ```

Advanced Example: Comparing BSSR Designs

```r library(bbssr) library(dplyr) library(ggplot2)

Compare different BSSR approaches

powercomparison <- tibble( Rule = factor( c('Restricted', 'Unrestricted', 'Weighted'), levels = c('Restricted', 'Unrestricted', 'Weighted') ), restricted = c(TRUE, FALSE, FALSE), weighted = c(FALSE, FALSE, TRUE) ) %>% groupbyall() %>% reframe(r = c(1, 2), N1 = c(24, 36), N2 = c(24, 18)) %>% groupby_all() %>% reframe( BinaryPowerBSSR( asmd.p1 = 0.45, asmd.p2 = 0.09, p = seq(0.1, 0.9, by = 0.01), Delta.A = 0.36, Delta.T = 0.36, N1, N2, omega = 0.5, r, alpha = 0.025, tar.power = 0.8, Test = 'Z-pool', restricted, weighted ) ) %>% mutate( Rule = factor(Rule, levels = c('Restricted', 'Unrestricted', 'Weighted')), Allocation = paste0('Allocation ratio = ', r, ':1') )

Visualize the results

ggplot(powercomparison, aes(x = p, y = power.BSSR, color = Rule)) + geomline(linewidth = 1.2) + facetwrap(~Allocation) + geomhline(yintercept = 0.8, color = 'gray', linetype = 'dashed') + labs( x = "Pooled Response Rate (θ)", y = "Power", title = "Power Comparison: BSSR Design Rules", subtitle = "Horizontal line shows target power = 0.8" ) + theme_minimal() + theme(legend.position = "bottom") ``` BSSR Design Comparison

The plot above demonstrates how different BSSR design rules perform across various pooled response rates. Key observations:

  • Weighted Design: Shows the most robust performance with consistent power across different pooled response rates
    • Unrestricted Design: Provides good flexibility while maintaining target power
    • Restricted Design: More conservative approach that ensures final sample size ≥ initial sample size
    • Allocation Ratios: Different allocation ratios (1:1 vs 2:1) show distinct power patterns

Key Functions

| Function | Purpose | |----------|---------| | BinaryPower() | Calculate power for traditional fixed-sample designs | | BinarySampleSize() | Calculate required sample size for given power | | BinaryPowerBSSR() | Calculate power for BSSR designs | | BinaryRR() | Compute rejection regions for exact tests |

Design Options for BSSR

Restricted Design (restricted = TRUE)

  • Conservative approach
  • Final sample size ≥ initially planned sample size
  • Maintains original study timeline

Unrestricted Design (restricted = FALSE)

  • Flexible approach
  • Allows both increases and decreases in sample size
  • Optimizes efficiency based on observed data

Weighted Design (weighted = TRUE)

  • Advanced approach
  • Uses weighted averaging across interim scenarios
  • Provides robust performance across different pooled response rates

Statistical Validity

All methods in bbssr maintain exact Type I error control at the specified α level. The package implements exact statistical tests rather than asymptotic approximations, ensuring validity even for small sample sizes commonly encountered in clinical trials.

Vignettes

For detailed examples and theoretical background, see: - vignette("bbssr-introduction") - Getting started guide - vignette("bbssr-statistical-methods") - Statistical methodology - vignette("bbssr-validation") - Function validation and performance comparison

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Author

Gosuke Homma


Note: This package is designed for use by statisticians and clinical researchers familiar with adaptive trial designs. For regulatory submissions, please consult with biostatisticians and regulatory affairs specialists to ensure compliance with relevant guidelines (FDA, EMA, etc.).

Owner

  • Login: gosukehommaEX
  • Kind: user

GitHub Events

Total
  • Push event: 20
  • Create event: 1
Last Year
  • Push event: 20
  • Create event: 1

Packages

  • Total packages: 1
  • Total downloads:
    • cran 213 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 1
  • Total maintainers: 1
cran.r-project.org: bbssr

Blinded Sample Size Re-Estimation for Binary Endpoints

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 213 Last month
Rankings
Dependent packages count: 26.2%
Dependent repos count: 32.3%
Average: 48.3%
Downloads: 86.4%
Maintainers (1)
Last synced: 11 months ago

Dependencies

DESCRIPTION cran
  • R >= 3.5.0 depends
  • fpCompare * imports
  • stats * imports