Two-arm Analysis for Continuous Data with Covariates from Raw Data using rpact

This document provides an example for importing raw data from a csv file, calculating estimated adjusted (marginal) means (EMMs, least-squares means) for a linear model, and performing two-arm interim analyses with these data. In this vignette, the case of an analysis of covariance (ANCOVA) model is illustrated.

Friedrich Pahlke and Gernot Wassmer


July 6, 2023


This vignette shows how to use the function getDataset() as an utility function to process adjusted means and estimated standard deviations from raw data, how to convert the raw data into an rpact dataset, and finally how to use this information for the analysis at interim and the final stage. Essentially, this is through the use of the CRAN package emmeans that allows the extraction of least squares means from a specified model which is an ANCOVA model in this vignette.


:::: {.infobox data-latex=““} This is an exclusive vignette for RPACT SLA customers. To read the whole vignette please login to My Account at

  • Setup and raw data import
    • Load required packages
    • Read raw data from local csv file
    • Check data
  • Interim analyses
    • First look: analysis at stage 1
      • Check the getDataset result
      • Create and display the analysis results:
    • Second look: analysis at stage 2
    • Last look: analysis at stage 3
  • Multi-stage raw data import
  • Conclusions ::::

System: rpact 3.4.0, R version 4.2.2 (2022-10-31 ucrt), platform: x86_64-w64-mingw32

To cite R in publications use:

R Core Team (2022). R: A language and environment for statistical computing. R Foundation for Statistical Computing, Vienna, Austria. URL

To cite package ‘rpact’ in publications use:

Wassmer G, Pahlke F (2023). rpact: Confirmatory Adaptive Clinical Trial Design and Analysis.,,,