Free examples and use-cases:   rpact vignettes
rpact: Confirmatory Adaptive Clinical Trial Design and Analysis

Summary

This R Markdown document provides different examples for creating one- and multi-arm analysis result plots with rpact and ggplot2.

1 Preparation

First, load the rpact package

library(rpact)
packageVersion("rpact") # version should be version 3.0 or later
## [1] '3.3.2'

2 Create a design

designIN <- getDesignInverseNormal(
    kMax = 4, alpha = 0.02,
    futilityBounds = c(-0.5, 0, 0.5), bindingFutility = FALSE,
    typeOfDesign = "asKD", gammaA = 1.2,
    informationRates = c(0.15, 0.4, 0.7, 1)
)

designF <- getDesignFisher(
    kMax = 4, alpha = 0.02,
    informationRates = c(0.15, 0.4, 0.7, 1)
)

3 Analysis results base

3.1 Analysis results base - means

simpleDataExampleMeans1 <- getDataset(
    n = c(120, 130, 130),
    means = c(0.45, 0.51, 0.45) * 100,
    stDevs = c(1.3, 1.4, 1.2) * 100
)

x <- getAnalysisResults(
    design = designIN, dataInput = simpleDataExampleMeans1,
    nPlanned = 130, thetaH0 = 30, thetaH1 = 60, assumedStDev = 100
)
## Calculation of final confidence interval performed for kMax = 4 (for kMax > 2, it is theoretically shown that it is valid only if no sample size change was performed)
plot(x, thetaRange = c(10, 80))