Getting started with survSampleSize

Overview

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 available:

Launching the application

The package exposes a single user-facing function, run_app(), which launches the Shiny application in your default browser:

library(survSampleSize)
run_app()

The interactive app relies on several packages declared in Suggests. If any are missing, run_app() reports which ones to install. You can install all of them up front with:

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

Workflow

Inside the app, the typical workflow is:

  1. Choose method and direction. Select either the Lu (2021) or Freedman (1982) method, and whether to solve for the sample size N given a target power, or to solve for the power given a fixed N.

  2. Statistical design parameters. Set the significance level (alpha), target power, one- vs. two-sided test, allocation ratio, and – for the Lu method – an optional non-inferiority margin.

  3. Time parameters (months). Set the accrual duration and the follow-up time after accrual ends. The Freedman method instead uses a single total study duration.

  4. Survival and effect parameters. Set the control-arm median survival, the target hazard ratio, and – for the Lu method – the delayed-effect (DTE) time, the annual dropout rate, the accrual rate, and the Fleming-Harrington weighting.

  5. Calculate. The results panel reports the total sample size, expected number of events, study duration, and/or estimated power. Additional tabs show the theoretical survival curves, a calendar-time event-prediction timeline, and a side-by-side comparison of the two methods.

References