Skip to main content

RPACT Code

Software
Clinical Trials
AI
Posit Connect
R Shiny App
GUI
An AI assistant for clinical trial design: explore scenarios in conversation, run rpact calculations, and take reproducible R code into expert review. Working alpha demo available on request.

From Clinical Questions to Reproducible Trial Designs

RPACT Code brings a conversational interface to clinical trial design. Describe your study, explore alternatives, and refine your assumptions in plain language. The assistant connects your questions to calculations in the validated R package rpact, with results, plots, and reproducible R code available for inspection and further work.

For pharmaceutical companies and contract research organizations (CROs), this opens a practical way to move from a design discussion to a documented statistical workflow, while keeping statisticians in the lead.

Request a short demo presentation

Why RPACT Code?

  • Explore design options more easily: Ask follow-up questions, change assumptions, and investigate their effects without writing every R call yourself or navigating a development environment.
  • Keep the calculations transparent: Statistical computations use rpact. The generated R code is visible, editable, and exportable, providing a concrete basis for reproduction and review.
  • Connect methods with practical questions: The assistant draws on rpact documentation, vignettes, and the accompanying clinical trial methodology textbook to explain methods and results in context.
  • Bring the team into the discussion: Organize conversations and reference files in projects, share project work with collaborators, and add comments where questions arise.
  • Carry the work forward: Download R code, R Markdown, Quarto, and a session report for further analysis, internal documentation, and expert review.

A Trial Design Conversation in Practice

A team planning a study might start with a question like this:

We are planning a two-arm superiority trial with a binary endpoint. Assume response rates of 40% and 25%, equal allocation, 90% power, and a two-sided significance level of 5%. Compare a fixed design with a group sequential design with one interim analysis at 50% information and O’Brien–Fleming boundaries.

The conversation can then develop into a sequence of design decisions:

  1. Define the design: Clarify study-specific inputs and make the assumptions underlying the calculation explicit.
  2. Explore alternatives: Calculate sample size and power, vary the assumed treatment effect, or investigate another interim analysis strategy.
  3. Discuss the implications: Inspect tables and plots and ask for an explanation of how the assumptions affect the design.
  4. Prepare for review: Inspect the R code, request an automated cross-check where supported, and send the work for human expert review.

This is an illustrative workflow. The statistical team remains responsible for assessing the assumptions, methods, and conclusions.

Built for Clinical Trial Design

RPACT Code combines a language model with purpose-built tools for working with rpact. The assistant uses registered R calculation tools and structured results, and can consult methodological references and relevant package implementation details when questions require closer investigation.

The current development version supports exploration of:

  • Fixed sample, group sequential, and adaptive trial designs.
  • Sample size and power for continuous, binary, count, and survival endpoints.
  • Simulation of adaptive strategies, including multi-arm treatment selection and enrichment designs.
  • Recruitment, follow-up, event probabilities, and sensitivity to design assumptions.
  • Design visualizations and explanations of the underlying methods.

Value for Pharmaceutical Companies and CROs

For pharmaceutical trial teams, RPACT Code can help turn clinical questions into concrete scenarios that statisticians and clinical colleagues can discuss together. Assumptions, calculations, code, and explanations stay connected as the design evolves.

For CROs, the same workflow can support early sponsor discussions, exploration of alternative designs, and preparation of material for statistical review. Exportable code and reports provide a starting point for project deliverables and subsequent R-based work.

For statistical teams, RPACT Code offers a conversational route into the rpact ecosystem. It complements the direct R interface and the graphical interface of RPACT Cloud, giving teams another way to explore methods and communicate design choices.

Statisticians in the Lead

RPACT Code is designed to make AI-assisted work inspectable. Users can examine the generated code and outputs, request automated checks of supported calculations, and ask for human expert review. Automated checks assist the review process; statistical judgment remains essential.

The validated rpact package provides the computational foundation. Validation of the complete RPACT Code assistant is a separate development goal.

Shaping Company-Internal Deployment

We plan to offer RPACT Code for deployment within a company’s own infrastructure. The intended direction includes a choice of language models, company-controlled computing resources, and the use of company-specific reference material such as protocol templates, standard operating procedures, and internal guidelines.

These deployment options are under development. We welcome discussions with pharmaceutical companies and CROs interested in helping shape a solution around their IT, confidentiality, and statistical workflows.

NoteAlpha Development — Working Demo Available

RPACT Code is in the alpha stage of development. A working demo version is already available, and functionality is being actively developed and tested. The complete assistant is not yet validated.

Interested in seeing RPACT Code in action? We would be happy to introduce the project in a short presentation, demonstrate the current version, and discuss your use cases and feedback. Contact RPACT to arrange a demo.