# rpact [![](https://www.r-pkg.org/badges/version/rpact)](https://cran.r-project.org/package=rpact) [![R-CMD-check](https://github.com/rpact-com/rpact/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/rpact-com/rpact/actions/workflows/R-CMD-check.yaml) [![Total downloads](https://cranlogs.r-pkg.org/badges/grand-total/rpact?color=blue)](https://CRAN.R-project.org/package=rpact) [![Monthly downloads](https://cranlogs.r-pkg.org/badges/rpact?color=blue)](https://CRAN.R-project.org/package=rpact) [![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable) [![License: LGPL v3](https://img.shields.io/badge/License-LGPL_v3-blue.svg)](https://cran.r-project.org/web/licenses/LGPL-3) [![Codecov test coverage](https://codecov.io/gh/rpact-com/rpact/branch/main/graph/badge.svg)](https://app.codecov.io/gh/rpact-com/rpact?branch=main) [![](https://img.shields.io/badge/DOI-10.1007/978--3--031--89669--9-yellow.svg?logo=doi)](https://doi.org/10.1007/978-3-031-89669-9) [![](https://img.shields.io/badge/RPACT-Cloud-blue.svg?logo=r)](https://rpact-cloud.share.connect.posit.cloud) [![](https://img.shields.io/badge/RPACT-Connect-669999.svg?labelColor=336699)](https://rpact-connect.share.connect.posit.cloud) `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, 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 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 sample size or event-number recalculations 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 - Simulation and analysis methods for population enrichment designs with means, rates, and hazard ratios ### Analysis and trial conduct - Confirmatory analysis for means, rates, and survival endpoints in one-arm, two-arm, and multi-arm trials - 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 ## Installation Install the latest stable release from CRAN: ``` r install.packages("rpact") ``` ### Development version To try features that are not yet available in the CRAN release, install the development version of `rpact` from [GitHub](https://github.com/rpact-com/rpact): ``` r # install.packages("pak") pak::pak("rpact-com/rpact") ``` ## Documentation The complete package documentation is available at [www.rpact.org](https://www.rpact.org). ## Vignettes Step-by-step examples and tutorials are available in the `rpact` vignettes at [www.rpact.org/vignettes](https://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](https://github.com/rpact-com/rpact/issues/new?template=bug_report.yml) Please include a minimal reproducible R example, or a runnable R Markdown (`.Rmd`) or Quarto (`.qmd`) document. - ✨ [Request a feature](https://github.com/rpact-com/rpact/issues/new?template=feature_request.yml) Please describe the use case, affected function(s), and the expected benefit. Before opening a new issue, please [search existing issues](https://github.com/rpact-com/rpact/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.cloud](https://demo.rpact.cloud) ## RPACT Connect **RPACT Connect** provides access to insights, downloads, and premium support for users and organizations working with RPACT software. [connect.rpact.com](https://connect.rpact.app) ## 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 perform the installation qualification with [`testPackage()`](https://docs.rpact.org/reference/testPackage.md). > [Contact RPACT](https://www.rpact.com/contact/) to learn more. ## About - **rpact** is a comprehensive R package for clinical trial planning, design, simulation, and analysis. It supports standard fixed-sample and classical group sequential designs, sample size and power calculations, simulation-based evaluation of operating characteristics, multi-stage adaptive designs, multi-arm and enrichment methods, and confirmatory trial analysis. `rpact` is free of charge and open source, licensed under [LGPL-3](https://cran.r-project.org/web/licenses/LGPL-3). It implements a broad range of methods described in the monograph by [Wassmer and Brannath (2025)](https://doi.org/10.1007%2F978-3-031-89669-9). Formal validation documentation is available to customers and supporting members. For more information, visit [www.rpact.com/services/sla](https://www.rpact.com/services/service-level-agreement/). > For package documentation, examples, and vignettes, visit > [www.rpact.org](https://www.rpact.org). - **RPACT** develops **Statistical Tools for Drug Development**. We build and support open-source and commercial software solutions for clinical research, including R packages, Shiny applications, validated workflows, and cloud-based tools for trial planning, simulation, dose finding, analysis, and reporting. RPACT is the team behind tools such as [rpact](https://cran.r-project.org/package=rpact), [crmPack](https://cran.r-project.org/package=crmPack), and [RPACT Cloud](https://rpact-cloud.share.connect.posit.cloud). > For more information, visit [www.rpact.com](https://www.rpact.com). # Package index ## All functions - [`as251Normal()`](https://docs.rpact.org/reference/as251Normal.md) : Algorithm AS 251: Normal Distribution - [`as251StudentT()`](https://docs.rpact.org/reference/as251StudentT.md) : Algorithm AS 251: Student T Distribution - [`obtain()`](https://docs.rpact.org/reference/fetch.ParameterSet.md) [`fetch()`](https://docs.rpact.org/reference/fetch.ParameterSet.md) : Extract a single parameter - [`getAccrualTime()`](https://docs.rpact.org/reference/getAccrualTime.md) : Get Accrual Time - [`getAnalysisResults()`](https://docs.rpact.org/reference/getAnalysisResults.md) : Get Analysis Results - [`plotTypes()`](https://docs.rpact.org/reference/getAvailablePlotTypes.md) [`getAvailablePlotTypes()`](https://docs.rpact.org/reference/getAvailablePlotTypes.md) : Get Available Plot Types - [`getClosedCombinationTestResults()`](https://docs.rpact.org/reference/getClosedCombinationTestResults.md) : Get Closed Combination Test Results - [`getClosedConditionalDunnettTestResults()`](https://docs.rpact.org/reference/getClosedConditionalDunnettTestResults.md) : Get Closed Conditional Dunnett Test Results - [`getConditionalPower()`](https://docs.rpact.org/reference/getConditionalPower.md) : Get Conditional Power - [`getConditionalRejectionProbabilities()`](https://docs.rpact.org/reference/getConditionalRejectionProbabilities.md) : Get Conditional Rejection Probabilities - [`getData()`](https://docs.rpact.org/reference/getData.md) [`getData.SimulationResults()`](https://docs.rpact.org/reference/getData.md) : Get Simulation Data - [`getDataset()`](https://docs.rpact.org/reference/getDataset.md) [`getDataSet()`](https://docs.rpact.org/reference/getDataset.md) : Get Dataset - [`getDesignCharacteristics()`](https://docs.rpact.org/reference/getDesignCharacteristics.md) : Get Design Characteristics - [`getDesignConditionalDunnett()`](https://docs.rpact.org/reference/getDesignConditionalDunnett.md) : Get Design Conditional Dunnett Test - [`getDesignFisher()`](https://docs.rpact.org/reference/getDesignFisher.md) : Get Design Fisher - [`getDesignFixed()`](https://docs.rpact.org/reference/getDesignFixed.md) : Get Fixed Design - [`getDesignGroupSequential()`](https://docs.rpact.org/reference/getDesignGroupSequential.md) : Get Design Group Sequential - [`getDesignInverseNormal()`](https://docs.rpact.org/reference/getDesignInverseNormal.md) : Get Design Inverse Normal - [`getDesignSet()`](https://docs.rpact.org/reference/getDesignSet.md) : Get Design Set - [`getEventProbabilities()`](https://docs.rpact.org/reference/getEventProbabilities.md) : Get Event Probabilities - [`getFinalConfidenceInterval()`](https://docs.rpact.org/reference/getFinalConfidenceInterval.md) : Get Final Confidence Interval - [`getFinalPValue()`](https://docs.rpact.org/reference/getFinalPValue.md) : Get Final P Value - [`getFisherInformation()`](https://docs.rpact.org/reference/getFisherInformation.md) : Get Fisher Information From a Design Plan or Simulation Results - [`getFutilityBounds()`](https://docs.rpact.org/reference/getFutilityBounds.md) : Get Futility Bounds - [`getGroupSequentialProbabilities()`](https://docs.rpact.org/reference/getGroupSequentialProbabilities.md) : Get Group Sequential Probabilities - [`getNumberOfSubjects()`](https://docs.rpact.org/reference/getNumberOfSubjects.md) : Get Number Of Subjects - [`rcmd()`](https://docs.rpact.org/reference/getObjectRCode.md) [`getObjectRCode()`](https://docs.rpact.org/reference/getObjectRCode.md) : Get Object R Code - [`getObservedInformationRates()`](https://docs.rpact.org/reference/getObservedInformationRates.md) : Get Observed Information Rates - [`getOutputFormat()`](https://docs.rpact.org/reference/getOutputFormat.md) : Get Output Format - [`getPerformanceScore()`](https://docs.rpact.org/reference/getPerformanceScore.md) : Get Performance Score - [`getPiecewiseSurvivalTime()`](https://docs.rpact.org/reference/getPiecewiseSurvivalTime.md) : Get Piecewise Survival Time - [`getPowerAndAverageSampleNumber()`](https://docs.rpact.org/reference/getPowerAndAverageSampleNumber.md) : Get Power And Average Sample Number - [`getPowerCounts()`](https://docs.rpact.org/reference/getPowerCounts.md) : Get Power Counts - [`getPowerMeans()`](https://docs.rpact.org/reference/getPowerMeans.md) : Get Power Means - [`getPowerRates()`](https://docs.rpact.org/reference/getPowerRates.md) : Get Power Rates - [`getPowerSurvival()`](https://docs.rpact.org/reference/getPowerSurvival.md) : Get Power Survival - [`getRawData()`](https://docs.rpact.org/reference/getRawData.md) : Get Simulation Raw Data for Survival - [`getRepeatedConfidenceIntervals()`](https://docs.rpact.org/reference/getRepeatedConfidenceIntervals.md) : Get Repeated Confidence Intervals - [`getRepeatedPValues()`](https://docs.rpact.org/reference/getRepeatedPValues.md) : Get Repeated P Values - [`getSampleSizeCounts()`](https://docs.rpact.org/reference/getSampleSizeCounts.md) : Get Sample Size Counts - [`getSampleSizeMeans()`](https://docs.rpact.org/reference/getSampleSizeMeans.md) : Get Sample Size Means - [`getSampleSizeRates()`](https://docs.rpact.org/reference/getSampleSizeRates.md) : Get Sample Size Rates - [`getSampleSizeSurvival()`](https://docs.rpact.org/reference/getSampleSizeSurvival.md) : Get Sample Size Survival - [`getSimulationCounts()`](https://docs.rpact.org/reference/getSimulationCounts.md) : Get Simulation Counts - [`getSimulationEnrichmentMeans()`](https://docs.rpact.org/reference/getSimulationEnrichmentMeans.md) : Get Simulation Enrichment Means - [`getSimulationEnrichmentRates()`](https://docs.rpact.org/reference/getSimulationEnrichmentRates.md) : Get Simulation Enrichment Rates - [`getSimulationEnrichmentSurvival()`](https://docs.rpact.org/reference/getSimulationEnrichmentSurvival.md) : Get Simulation Enrichment Survival - [`getSimulationMeans()`](https://docs.rpact.org/reference/getSimulationMeans.md) : Get Simulation Means - [`getSimulationMultiArmMeans()`](https://docs.rpact.org/reference/getSimulationMultiArmMeans.md) : Get Simulation Multi-Arm Means - [`getSimulationMultiArmRates()`](https://docs.rpact.org/reference/getSimulationMultiArmRates.md) : Get Simulation Multi-Arm Rates - [`getSimulationMultiArmSurvival()`](https://docs.rpact.org/reference/getSimulationMultiArmSurvival.md) : Get Simulation Multi-Arm Survival - [`getSimulationRates()`](https://docs.rpact.org/reference/getSimulationRates.md) : Get Simulation Rates - [`getSimulationSurvival()`](https://docs.rpact.org/reference/getSimulationSurvival.md) : Get Simulation Survival - [`getStageResults()`](https://docs.rpact.org/reference/getStageResults.md) : Get Stage Results - [`getTestActions()`](https://docs.rpact.org/reference/getTestActions.md) : Get Test Actions - [`knit_print(`*``*`)`](https://docs.rpact.org/reference/knit_print.SummaryFactory.md) : Print Summary Factory in Markdown Code Chunks - [`mvnprd()`](https://docs.rpact.org/reference/mvnprd.md) : Original Algorithm AS 251: Normal Distribution - [`mvstud()`](https://docs.rpact.org/reference/mvstud.md) : Original Algorithm AS 251: Student T Distribution - [`plot(`*``*`)`](https://docs.rpact.org/reference/plot.AnalysisResults.md) : Analysis Results Plotting - [`plot(`*``*`)`](https://docs.rpact.org/reference/plot.Dataset.md) : Dataset Plotting - [`plot(`*``*`)`](https://docs.rpact.org/reference/plot.EventProbabilities.md) : Event Probabilities Plotting - [`plot(`*``*`)`](https://docs.rpact.org/reference/plot.NumberOfSubjects.md) : Number Of Subjects Plotting - [`plot(`*``*`)`](https://docs.rpact.org/reference/plot.ParameterSet.md) : Parameter Set Plotting - [`plot(`*``*`)`](https://docs.rpact.org/reference/plot.SimulationResults.md) : Simulation Results Plotting - [`plot(`*``*`)`](https://docs.rpact.org/reference/plot.StageResults.md) : Stage Results Plotting - [`plot(`*``*`)`](https://docs.rpact.org/reference/plot.SummaryFactory.md) : Summary Factory Plotting - [`plot(`*``*`)`](https://docs.rpact.org/reference/plot.TrialDesign.md) [`plot(`*``*`)`](https://docs.rpact.org/reference/plot.TrialDesign.md) : Trial Design Plotting - [`plot(`*``*`)`](https://docs.rpact.org/reference/plot.TrialDesignPlan.md) : Trial Design Plan Plotting - [`plot(`*``*`)`](https://docs.rpact.org/reference/plot.TrialDesignSet.md) : Trial Design Set Plotting - [`plot(`*``*`)`](https://docs.rpact.org/reference/plot.TrialDesignSummaries.md) : Plot Trial Design Summaries - [`print(`*``*`)`](https://docs.rpact.org/reference/print.SummaryFactory.md) : Summary Factory Printing - [`print(`*``*`)`](https://docs.rpact.org/reference/print.TrialDesignCharacteristics.md) : Trial Design Characteristics Printing - [`print(`*``*`)`](https://docs.rpact.org/reference/print.TrialDesignSummaries.md) : Print Trial Design Summaries - [`readDataset()`](https://docs.rpact.org/reference/readDataset.md) : Read Dataset - [`readDatasets()`](https://docs.rpact.org/reference/readDatasets.md) : Read Multiple Datasets - [`rpact-package`](https://docs.rpact.org/reference/rpact.md) [`rpact`](https://docs.rpact.org/reference/rpact.md) : rpact - Confirmatory Adaptive Clinical Trial Design and Analysis - [`setOutputFormat()`](https://docs.rpact.org/reference/setOutputFormat.md) : Set Output Format - [`testPackage()`](https://docs.rpact.org/reference/testPackage.md) : Test and Validate the rpact Package Installation - [`getPiecewiseExponentialDistribution()`](https://docs.rpact.org/reference/utilitiesForPiecewiseExponentialDistribution.md) [`ppwexp()`](https://docs.rpact.org/reference/utilitiesForPiecewiseExponentialDistribution.md) [`getPiecewiseExponentialQuantile()`](https://docs.rpact.org/reference/utilitiesForPiecewiseExponentialDistribution.md) [`qpwexp()`](https://docs.rpact.org/reference/utilitiesForPiecewiseExponentialDistribution.md) [`getPiecewiseExponentialRandomNumbers()`](https://docs.rpact.org/reference/utilitiesForPiecewiseExponentialDistribution.md) [`rpwexp()`](https://docs.rpact.org/reference/utilitiesForPiecewiseExponentialDistribution.md) : The Piecewise Exponential Distribution - [`writeDataset()`](https://docs.rpact.org/reference/writeDataset.md) : Write Dataset - [`writeDatasets()`](https://docs.rpact.org/reference/writeDatasets.md) : Write Multiple Datasets # Articles ### All vignettes - [Getting started with rpact](https://docs.rpact.org/articles/rpact_getting_started.md):