This R Markdown document provides many different examples for creating one- and multi-arm analysis result plots with rpact and ggplot2.
First, load the rpact package
## [1] '3.2.1'
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)
simpleDataExampleMeans2 <- getDataset(
n1 = c(23, 13, 22, 13),
n2 = c(22, 11, 22, 11),
means1 = c(2.7, 2.5, 4.5, 2.5) * 100,
means2 = c(1, 1.1, 1.3, 1) * 100,
stds1 = c(1.3, 2.4, 2.2, 1.3) * 100,
stds2 = c(1.2, 2.2, 2.1, 1.3) * 100
)
x <- getAnalysisResults(design = designIN, dataInput = simpleDataExampleMeans2,
thetaH0 = 110, equalVariances = TRUE, directionUpper = TRUE, stage = 2)
plot(x, nPlanned = c(20, 30))