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:
lrstat package), which supports non-proportional hazards,
delayed treatment effects, unequal allocation, dropout, non-inferiority
testing, and Fleming-Harrington weighted log-rank statistics.powerSurvEpi package) for the proportional-hazards
setting.The package exposes a single user-facing function,
run_app(), which launches the Shiny application in your
default browser:
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:
Inside the app, the typical workflow is:
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.
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.
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.
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.
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.