MyNixOS website logo
Description

Sample Size and Power Calculation for Two Co-Primary Endpoints.

Comprehensive functions to calculate sample size and power for clinical trials with two co-primary endpoints. The package supports five endpoint combinations: two continuous endpoints (Sozu et al. 2011 <doi:10.1080/10543406.2011.551329>), two binary endpoints using asymptotic methods (Sozu et al. 2010 <doi:10.1002/sim.3972>) and exact methods (Homma and Yoshida 2025 <doi:10.1177/09622802251368697>), mixed continuous and binary endpoints (Sozu et al. 2012 <doi:10.1002/bimj.201100221>), and mixed count and continuous endpoints (Homma and Yoshida 2024 <doi:10.1002/pst.2337>). All methods appropriately account for correlation between endpoints and provide both sample size and power calculation capabilities.

twoCoprimary

R-CMD-check CRAN status Lifecycle: stable License: MIT CRAN downloads

Overview

twoCoprimary provides comprehensive tools for sample size and power calculation in clinical trials with two co-primary endpoints. In co-primary endpoint trials, treatment success requires demonstrating statistically significant effects on all primary endpoints simultaneously. This package implements state-of-the-art methodologies that properly account for correlation between endpoints, leading to more efficient trial designs.

📖 Documentation Website

Key Features

The package supports five combinations of co-primary endpoints:

  • Two continuous endpoints - Normal distribution with correlation (Sozu et al., 2011)
  • Two binary endpoints (asymptotic) - Large sample approximation methods (Sozu et al., 2010)
  • Two binary endpoints (exact) - Exact inference for small to medium samples (Homma & Yoshida, 2025)
  • Mixed continuous and binary - Biserial correlation structure (Sozu et al., 2012)
  • Mixed count and continuous - Negative binomial for overdispersed counts (Homma & Yoshida, 2024)

All methods provide:

  • ✅ Sample size calculation given target power
  • ✅ Power calculation given sample size
  • ✅ Proper Type I error control without multiplicity adjustment
  • ✅ Accounting for correlation between endpoints
  • ✅ Support for unbalanced allocation ratios

Installation

Install from CRAN:

install.packages("twoCoprimary")

Or install the development version from GitHub:

# install.packages("pak")
pak::pak("gosukehommaEX/twoCoprimary")

Quick Start

Example 1: Two Continuous Endpoints

Calculate sample size for a trial with two continuous co-primary endpoints:

library(twoCoprimary)

# Sample size calculation
result <- ss2Continuous(
  delta1 = 0.5,      # Standardized effect size for endpoint 1
  delta2 = 0.4,      # Standardized effect size for endpoint 2
  rho = 0.3,         # Correlation between endpoints
  alpha = 0.025,     # One-sided significance level
  power = 0.80,      # Target power
  r = 1              # Allocation ratio (1:1)
)

print(result)
#> 
#> Sample size calculation for two continuous co-primary endpoints
#> 
#> Parameters:
#>   Effect sizes: delta1 = 0.5, delta2 = 0.4
#>   Correlation: rho = 0.3
#>   Significance level: alpha = 0.025 (one-sided)
#>   Target power: 1 - beta = 0.8
#>   Allocation ratio: r = 1
#> 
#> Results:
#>   Sample size per group: n1 = n2 = 130
#>   Total sample size: N = 260

Example 2: Two Binary Endpoints (Exact Method)

For small to medium sample sizes, use exact methods:

# Sample size with exact inference
result_exact <- ss2BinaryExact(
  p11 = 0.30, p12 = 0.15,    # Response rates for endpoint 1
  p21 = 0.50, p22 = 0.30,    # Response rates for endpoint 2
  rho1 = 0.3, rho2 = 0.3,    # Within-group correlations
  alpha = 0.025,             # One-sided significance level
  power = 0.80,              # Target power
  r = 1,                     # Allocation ratio
  test_method = "Fisher"     # Exact test method
)

print(result_exact)

Example 3: Mixed Count and Continuous Endpoints

For COPD/asthma trials with exacerbation count and lung function:

# Exacerbation rates (events per year)
r1 <- 0.80  # Treatment group
r2 <- 1.25  # Control group

# Sample size calculation
result_mixed <- ss2MixedCountContinuous(
  r1 = r1, r2 = r2,          # Event rates
  nu = 1.0,                  # Dispersion parameter
  t = 1,                     # Follow-up period (years)
  mu1 = 250, mu2 = 200,      # Mean FEV1 (mL)
  sd = 300,                  # Common SD
  rho1 = 0.5, rho2 = 0.5,    # Correlations
  alpha = 0.025,
  power = 0.80,
  r = 1
)

print(result_mixed)

Documentation

Comprehensive vignettes are available:

References

  1. Homma, G., & Yoshida, T. (2025). Exact power and sample size in clinical trials with two co-primary binary endpoints. Statistical Methods in Medical Research, 34(1). https://doi.org/10.1177/09622802251368697

  2. Homma, G., & Yoshida, T. (2024). Sample size calculation for clinical trials with co‐primary outcomes: Negative binomial and continuous outcomes. Pharmaceutical Statistics, 23(3), 368-392. https://doi.org/10.1002/pst.2337

  3. Sozu, T., Kanou, T., Hamada, C., & Yoshimura, I. (2011). Power and sample size calculations in clinical trials with multiple primary variables. Japanese Journal of Biometrics, 32(2), 83-96. https://doi.org/10.5691/jjb.32.83

  4. Sozu, T., Sugimoto, T., Hamasaki, T., & Evans, S. R. (2012). Sample size determination in clinical trials with multiple co-primary binary endpoints including mixed binary and continuous endpoints. Biometrical Journal, 54(5), 716-729. https://doi.org/10.1002/bimj.201100221

  5. Sozu, T., Sugimoto, T., Hamasaki, T., & Evans, S. R. (2010). Sample size determination in superiority clinical trials with multiple co-primary correlated endpoints. Statistics in Medicine, 29(21), 2219-2227. https://doi.org/10.1002/sim.3972

Citation

citation("twoCoprimary")

Getting Help

License

MIT © Gosuke Homma.

Metadata

Version

1.0.0

License

Unknown

Platforms (78)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    uefi
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-uefi
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-uefi
  • x86_64-windows