MyNixOS website logo
Description

Sample Size Calculator for Survival Endpoint Clinical Trials.

An interactive 'shiny' application for sample size and power calculation under general conditions for clinical trials with survival endpoints. Implements the weighted log-rank method of Lu (2021) <doi:10.1002/pst.2069> via the 'lrstat' package, supporting non-proportional hazards, delayed treatment effects, unequal allocation and dropout, as well as the classic method of Freedman (1982) <doi:10.1002/sim.4780010204> via the 'powerSurvEpi' package. Results are presented interactively with survival curves and event-prediction timelines.

survSampleSize

survSampleSize provides an interactive Shiny application for sample size and power calculation in clinical trials with a survival (time-to-event) endpoint, under general design conditions.

Two complementary methods are implemented:

  • Lu (2021) weighted log-rank method (via the lrstat package), supporting non-proportional hazards, delayed treatment effects (DTE), unequal allocation, dropout, non-inferiority testing, and Fleming-Harrington weighted log-rank statistics.
  • Freedman (1982) classic method (via the powerSurvEpi package) for the proportional-hazards setting.

The app also displays theoretical survival curves and a calendar-time event-prediction timeline, and offers a side-by-side comparison of the two methods.

Installation

Install from CRAN:

install.packages("survSampleSize")

Or install the development version:

# install.packages("remotes")
remotes::install_github("wettlinmalfa629-hue/survSampleSize")

The interactive app relies on several packages declared in Suggests. Install them with:

install.packages(c(
  "lrstat", "powerSurvEpi", "DT", "ggplot2", "bslib", "plotly"
))

Usage

Launch the application with:

library(survSampleSize)
run_app()

This opens the Shiny app in your default browser. From there you can:

  1. Choose a calculation method (Lu 2021 or Freedman 1982) and direction (solve for sample size N given power, or solve for power given N).
  2. Set the statistical design parameters (alpha, power, test type, allocation ratio, non-inferiority margin).
  3. Set the time parameters (accrual duration, follow-up time).
  4. Set the survival and effect-size parameters (control median survival, target hazard ratio, delayed-effect time, dropout rate, accrual rate).
  5. Click Calculate to view the results, survival curves, event-prediction timeline, and a method comparison.

References

  • Freedman, L. S. (1982). Tables of the number of patients required in clinical trials using the log-rank test. Statistics in Medicine, 1(2), 121-129. doi:10.1002/sim.4780010204
  • Lu, K. (2021). Sample size calculation for logrank test and prediction of number of events over time. Pharmaceutical Statistics, 20(2), 229-244. doi:10.1002/pst.2069
Metadata

Version

0.1.2

License

Unknown

Platforms (79)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    uefi
    wasip1
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-uefi
  • aarch64-windows
  • aarch64_be-none
  • arc-linux
  • 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
  • sh4-linux
  • vc4-none
  • wasm32-wasip1
  • wasm64-wasip1
  • x86_64-cygwin
  • 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