rpact is an R package for planning, simulating, and analyzing confirmatory clinical trials. It supports common tasks such as sample size and power calculations for standard fixed-sample trials, as well as classical group sequential designs with interim analyses. Methods are available for continuous, binary, survival (time-to-event), and count data endpoints.
For innovative trial designs, rpact provides simulation-based evaluation of power and other operating characteristics, multi-stage adaptive hypothesis tests based on the combination testing principle, adaptive sample size or event-number reassessment, multi-arm multi-stage (MAMS) designs, and population enrichment designs. This allows users to start with routine trial planning and use the same package for more advanced adaptive methods when needed.
What rpact can do
rpact covers the main steps of confirmatory trial planning, simulation, and analysis:
Sample size and power planning
- Standard fixed-sample designs without interim analyses
- Classical group sequential designs with planned interim analyses
- Sample size and power calculations for
- means (continuous endpoints)
- rates (binary endpoints)
- survival (time-to-event) endpoints with flexible recruitment and survival-time options
- count data endpoints
Simulation and adaptive trial design
- Power and operating-characteristic simulations for means, rates, survival data, and count data
- Assessment of adaptive sample size or event-number reassessment based on conditional power
- Multi-stage adaptive hypothesis testing based on the combination testing principle
- Assessment of treatment selection strategies in multi-arm trials, including multi-arm multi-stage (MAMS) settings for means, rates, and survival endpoints
- Simulation and analysis methods for population enrichment designs with means, rates, and hazard ratios
Analysis and trial conduct
- Confirmatory analysis for means and rates in one-arm and two-arm trials, and for survival endpoints in treatment comparisons
- Multi-arm and population enrichment analysis for means, rates, and survival endpoints
- Analysis of general estimates and standard errors supplied through
getDataset(est = ..., se = ...)(development version) - Support for fixed-sample designs, classical group sequential designs, and adaptive multi-arm multi-stage (MAMS) designs based on the inverse normal or Fisher combination test
- Automatic boundary recalculation during a trial using alpha-spending approaches, including under- and over-running
Quick start
Plan a two-arm trial with a continuous endpoint and three analyses. This example uses a one-sided significance level of 0.025, 90% power, an expected mean difference of 0.5, and a common standard deviation of 1.
library(rpact)
getDesignGroupSequential(
kMax = 3,
informationRates = c(0.5, 0.75, 1),
alpha = 0.025,
beta = 0.1,
sided = 1,
typeOfDesign = "OF"
) |>
getSampleSizeMeans(
groups = 2,
alternative = 0.5,
stDev = 1,
allocationRatioPlanned = 1
) |>
summary()Sample size calculation for a continuous endpoint
Sequential analysis with a maximum of three looks (group sequential design), one-sided overall significance level 2.5%, power 90%. The results were calculated for a two-sample t-test, H0: mu(1) - mu(2) = 0, H1: effect = 0.5, standard deviation = 1.
| Stage | 1 | 2 | 3 |
|---|---|---|---|
| Planned information rate | 50% | 75% | 100% |
| Cumulative alpha spent | 0.0021 | 0.0105 | 0.0250 |
| Stage levels (one-sided) | 0.0021 | 0.0097 | 0.0215 |
| Efficacy boundary (z-value scale) | 2.863 | 2.337 | 2.024 |
| Efficacy boundary (t) | 0.631 | 0.415 | 0.309 |
| Cumulative power | 0.2928 | 0.6960 | 0.9000 |
| Number of subjects | 86.9 | 130.4 | 173.8 |
| Expected number of subjects under H1 | 130.9 | ||
| Stopping probability | 0.6960 | ||
| Efficacy stopping probability by stage (under H0) | 0.0021 | 0.0084 | |
| Efficacy stopping probability by stage | 0.2928 | 0.4033 |
Legend:
- (t): treatment effect scale
The result includes the required sample sizes at each analysis. To evaluate power for a specified maximum sample size, use getPowerMeans().
Documentation
Package information and tutorials are available at www.rpact.org. For function arguments, return values, and examples, see the function reference.
Vignettes
Step-by-step examples and tutorials are available in the rpact vignettes at www.rpact.org/vignettes.
Issues and Feature Requests
If you find a bug or would like to suggest an improvement, please use the rpact GitHub issue tracker.
🐞 Report a bug
Please include a minimal reproducible R example, or a runnable R Markdown (.Rmd) or Quarto (.qmd) document.✨ Request a feature
Please describe the use case, affected function(s), and the expected benefit.
Before opening a new issue, please search existing issues to avoid duplicates.
Because GitHub issues are public, please do not include confidential, customer-specific, personal, regulated, or security-sensitive information.
RPACT Cloud
RPACT Cloud is a web-based graphical user interface for rpact. It provides guided, browser-based access to selected rpact functionality, including study design, sample size calculation, simulation, and reporting, without requiring users to write R code.
RPACT Connect
RPACT Connect provides access to insights, downloads, and premium support for users and organizations working with RPACT software.
The RPACT User Group
The RPACT User Group brings together users and decision-makers from the pharmaceutical industry and CROs. Members meet regularly to exchange experience, discuss best practices, and provide input that helps shape the open-source development of rpact.
We invite interested users and organizations to join the community, share know-how, and contribute to the future development of statistical tools for clinical trials.
Use in regulated corporate environments
For organizations using rpact in FDA/GxP-regulated environments, RPACT offers support and formal validation documentation for use on validated corporate computer systems. The documentation can be customized and licensed for exclusive use by your company to support applicable regulatory requirements.
The validation documentation also contains the personal access data required to run the full test suite for installation qualification with testPackage().
Contact RPACT to learn more.
About
rpact is free of charge and open source, licensed under LGPL-3. It implements a broad range of methods described in the monograph by Wassmer and Brannath (2025). Formal validation documentation is available to customers and supporting members through the RPACT service level agreement.
RPACT GmbH develops Statistical Tools for Drug Development. We develop and support R packages, Shiny applications, and cloud-based tools for clinical research, with services covering software development, validation, technical support, consulting, and training.
Our products include rpact and RPACT Cloud. We also maintain and support crmPack, the open-source package for dose escalation trial design, simulation, and analysis.
For more information, visit www.rpact.com.
