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.0.3'`

```
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))
```

```
simpleDataExampleRates1 <- getDataset(
n = c(8, 10, 9, 11),
events = c(4, 5, 5, 6)
)
x <- getAnalysisResults(design = designIN, dataInput = simpleDataExampleRates1,
stage = 3, thetaH0 = 0.75, normalApproximation = TRUE,
directionUpper = FALSE, nPlanned = 10)
```

`## 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)`

`## Warning: Removed 1 row(s) containing missing values (geom_path).`

```
x <- getAnalysisResults(design = designIN, dataInput = simpleDataExampleRates1,
stage = 3, thetaH0 = 0.75, normalApproximation = FALSE,
directionUpper = FALSE)
plot(x, nPlanned = 20)
```

`## Warning: Removed 1 row(s) containing missing values (geom_path).`

```
simpleDataExampleRates2 <- getDataset(
n1 = c(17, 23, 22),
n2 = c(18, 20, 19),
events1 = c(11, 12, 17),
events2 = c(5, 10, 7)
)
x <- getAnalysisResults(designIN, simpleDataExampleRates2, thetaH0 = 0,
stage = 2, directionUpper = TRUE, normalApproximation = FALSE,
pi1 = 0.9, pi2 = 0.3, nPlanned = c(20, 20))
```

`## Repeated confidence intervals will be calculated under the normal approximation`

```
simpleDataExampleSurvival <- getDataset(
overallEvents = c(8, 15, 29),
overallAllocationRatios = c(1, 1, 1),
overallLogRanks = c(1.52, 1.38, 2.9)
)
x <- getAnalysisResults(designIN, simpleDataExampleSurvival,
directionUpper = TRUE, nPlanned = 20)
```

`## 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)`