This R Markdown document
provides many different examples that illustrate the usage of the *R
generic function* `summary`

with rpact. This is a
technical vignette and is to be considered mainly as a comprehensive
overview of the possible summaries in rpact.

**First, load the rpact package**

```
library(rpact)
packageVersion("rpact")
```

`## [1] '3.3.2'`

The following options can be set globally:

`rpact.summary.output.size`

: one of c(“small”, “medium”,
“large”); defines how many details will be included into the summary;
default is “large”, i.e., all available details are displayed.

`rpact.summary.justify`

: one of c(“right”, “left”,
“centre”); shall the values be right-justified (the default),
left-justified or centered.

`rpact.summary.intervalFormat`

: defines how intervals will
be displayed in the summary, default is “[%s; %s]”.

`rpact.summary.digits`

: defines how many digits are to be
used for numeric values (default is 3).

`rpact.summary.digits.probs`

: defines how many digits are
to be used for numeric values (default is one more than value of
rpact.summary.digits, i.e., 4).

`rpact.summary.trim.zeroes`

: if TRUE (default) zeroes will
always displayed as “0”, e.g. “0.000” will become “0”.

**Examples**

```
options("rpact.summary.output.size" = "small") # small, medium, large
options("rpact.summary.output.size" = "medium") # small, medium, large
options("rpact.summary.output.size" = "large") # small, medium, large
options("rpact.summary.intervalFormat" = "[%s; %s]")
options("rpact.summary.intervalFormat" = "%s - %s")
options("rpact.summary.justify" = "left")
options("rpact.summary.justify" = "centre")
options("rpact.summary.justify" = "right")
```

```
kable(summary(getDesignGroupSequential(
beta = 0.05, typeOfDesign = "asKD", gammaA = 1,
typeBetaSpending = "bsOF"
)))
```

**Sequential analysis with a maximum of 3 looks (group
sequential design)**

Kim & DeMets alpha spending design (gammaA = 1) and O’Brien & Fleming type beta spending, non-binding futility, one-sided overall significance level 2.5%, power 95%, undefined endpoint, inflation factor 1.1247, ASN H1 0.6553, ASN H01 0.8792, ASN H0 0.7415.

Stage | 1 | 2 | 3 |
---|---|---|---|

Information rate | 33.3% | 66.7% | 100% |

Efficacy boundary (z-value scale) | 2.394 | 2.294 | 2.200 |

Stage Levels | 0.0083 | 0.0109 | 0.0139 |

Futility boundary (z-value scale) | -0.993 | 0.982 | |

Cumulative alpha spent | 0.0083 | 0.0167 | 0.0250 |

Cumulative beta spent | 0.0007 | 0.0164 | 0.0500 |

Overall power | 0.4259 | 0.8092 | 0.9500 |

Futility probabilities under H1 | <0.001 | 0.016 |

`kable(summary(getDesignGroupSequential(kMax = 1)))`

**Fixed sample analysis**

O’Brien & Fleming design, one-sided significance level 2.5%, power 80%, undefined endpoint.

Stage | Fixed |
---|---|

Efficacy boundary (z-value scale) | 1.960 |

Stage Levels | 0.0250 |

`kable(summary(getDesignGroupSequential(kMax = 4, sided = 2)))`

**Sequential analysis with a maximum of 4 looks (group
sequential design)**

O’Brien & Fleming design, two-sided overall significance level 2.5%, power 80%, undefined endpoint, inflation factor 1.017, ASN H1 0.8458, ASN H01 0.9876, ASN H0 1.0144.

Stage | 1 | 2 | 3 | 4 |
---|---|---|---|---|

Information rate | 25% | 50% | 75% | 100% |

Efficacy boundary (z-value scale) | 4.579 | 3.238 | 2.644 | 2.289 |

Stage Levels | <0.0001 | 0.0006 | 0.0041 | 0.0110 |

Cumulative alpha spent | <0.0001 | 0.0012 | 0.0086 | 0.0250 |

Overall power | 0.0012 | 0.1494 | 0.5227 | 0.8000 |

`kable(summary(getDesignGroupSequential(kMax = 4, sided = 2), digits = 0))`

**Sequential analysis with a maximum of 4 looks (group
sequential design)**

O’Brien & Fleming design, two-sided overall significance level 2.5%, power 80%, undefined endpoint, inflation factor 1.017, ASN H1 0.8458, ASN H01 0.9876, ASN H0 1.0144.

Stage | 1 | 2 | 3 | 4 |
---|---|---|---|---|

Information rate | 25% | 50% | 75% | 100% |

Efficacy boundary (z-value scale) | 4.579 | 3.238 | 2.644 | 2.289 |

Stage Levels | 0.000002339 | 0.000602619 | 0.004102447 | 0.011029355 |

Cumulative alpha spent | 0.000004679 | 0.001207215 | 0.008644578 | 0.024999990 |

Overall power | 0.001247 | 0.149399 | 0.522709 | 0.800000 |

`kable(summary(getDesignGroupSequential(futilityBounds = c(-6, 0)), digits = 5))`

**Sequential analysis with a maximum of 3 looks (group
sequential design)**

O’Brien & Fleming design, non-binding futility, one-sided overall significance level 2.5%, power 80%, undefined endpoint, inflation factor 1.0178, ASN H1 0.8529, ASN H01 0.9413, ASN H0 0.8457.

Stage | 1 | 2 | 3 |
---|---|---|---|

Information rate | 33.3% | 66.7% | 100% |

Efficacy boundary (z-value scale) | 3.47109 | 2.45443 | 2.00404 |

Stage Levels | 0.000259 | 0.007055 | 0.022533 |

Futility boundary (z-value scale) | -Inf | 0 | |

Cumulative alpha spent | 0.000259 | 0.007160 | 0.025000 |

Overall power | 0.032939 | 0.442575 | 0.800000 |

Futility probabilities under H1 | 0 | 0.01051 |

`kable(summary(getSampleSizeMeans(sided = 2, alternative = -0.5)))`

**Sample size calculation for a continuous
endpoint**

Fixed sample analysis, significance level 2.5% (two-sided). The sample size was calculated for a two-sample t-test, H0: mu(1) - mu(2) = 0, H1: effect = -0.5, standard deviation = 1, power 80%.

Stage | Fixed |
---|---|

Efficacy boundary (z-value scale) | 2.241 |

Number of subjects | 154.6 |

Two-sided local significance level | 0.0250 |

Lower efficacy boundary (t) | -0.364 |

Upper efficacy boundary (t) | 0.364 |

Legend:

*(t)*: treatment effect scale

```
kable(summary(getPowerMeans(
sided = 1, alternative = c(-0.5, -0.3),
maxNumberOfSubjects = 100, directionUpper = FALSE
)))
```

**Power calculation for a continuous endpoint**

Fixed sample analysis, significance level 2.5% (one-sided). The results were calculated for a two-sample t-test, H0: mu(1) - mu(2) = 0, power directed towards smaller values, H1: effect as specified, standard deviation = 1, number of subjects = 100.

Stage | Fixed |
---|---|

Efficacy boundary (z-value scale) | 1.960 |

Power, alt. = -0.5 | 0.6969 |

Power, alt. = -0.3 | 0.3175 |

Number of subjects | 100.0 |

One-sided local significance level | 0.0250 |

Efficacy boundary (t) | -0.397 |

Legend:

*alt.*: alternative*(t)*: treatment effect scale

`kable(summary(getSampleSizeMeans(getDesignGroupSequential(futilityBounds = c(1, 2))), digits = 0))`

**Sample size calculation for a continuous
endpoint**

Sequential analysis with a maximum of 3 looks (group sequential design), overall significance level 2.5% (one-sided). The sample size was calculated for a two-sample t-test, H0: mu(1) - mu(2) = 0, H1: effect as specified, standard deviation = 1, power 80%.

Stage | 1 | 2 | 3 |
---|---|---|---|

Information rate | 33.3% | 66.7% | 100% |

Efficacy boundary (z-value scale) | 3.471 | 2.454 | 2.004 |

Futility boundary (z-value scale) | 1.000 | 2.000 | |

Overall power | 0.09667 | 0.70304 | 0.80000 |

Expected number of subjects, alt. = 0.2 | 888.9 | ||

Expected number of subjects, alt. = 0.4 | 223.9 | ||

Expected number of subjects, alt. = 0.6 | 100.7 | ||

Expected number of subjects, alt. = 0.8 | 57.7 | ||

Expected number of subjects, alt. = 1 | 37.8 | ||

Number of subjects, alt. = 0.2 | 472.2 | 944.4 | 1416.5 |

Number of subjects, alt. = 0.4 | 118.9 | 237.8 | 356.8 |

Number of subjects, alt. = 0.6 | 53.5 | 107 | 160.5 |

Number of subjects, alt. = 0.8 | 30.6 | 61.3 | 91.9 |

Number of subjects, alt. = 1 | 20.1 | 40.1 | 60.2 |

Cumulative alpha spent | 0.0002592 | 0.0071601 | 0.0250000 |

One-sided local significance level | 0.0002592 | 0.0070554 | 0.0225331 |

Efficacy boundary (t), alt. = 0.2 | 0.322 | 0.160 | 0.107 |

Efficacy boundary (t), alt. = 0.4 | 0.655 | 0.321 | 0.213 |

Efficacy boundary (t), alt. = 0.6 | 1.013 | 0.483 | 0.319 |

Efficacy boundary (t), alt. = 0.8 | 1.413 | 0.646 | 0.424 |

Efficacy boundary (t), alt. = 1 | 1.882 | 0.812 | 0.528 |

Futility boundary (t), alt. = 0.2 | 0.0921 | 0.1303 | |

Futility boundary (t), alt. = 0.4 | 0.184 | 0.261 | |

Futility boundary (t), alt. = 0.6 | 0.276 | 0.391 | |

Futility boundary (t), alt. = 0.8 | 0.368 | 0.522 | |

Futility boundary (t), alt. = 1 | 0.459 | 0.653 | |

Overall exit probability (under H0) | 0.8416 | 0.1462 | |

Overall exit probability (under H1) | 0.2176 | 0.6822 | |

Exit probability for efficacy (under H0) | 0.0002592 | 0.0062354 | |

Exit probability for efficacy (under H1) | 0.09667 | 0.60637 | |

Exit probability for futility (under H0) | 0.8413 | 0.1400 | |

Exit probability for futility (under H1) | 0.12094 | 0.07581 |

Legend:

*alt.*: alternative*(t)*: treatment effect scale

```
kable(summary(getPowerMeans(getDesignGroupSequential(futilityBounds = c(1, 2)),
maxNumberOfSubjects = 100, alternative = 1
)))
```

**Power calculation for a continuous endpoint**

Sequential analysis with a maximum of 3 looks (group sequential design), overall significance level 2.5% (one-sided). The results were calculated for a two-sample t-test, H0: mu(1) - mu(2) = 0, power directed towards larger values, H1: effect = 1, standard deviation = 1, maximum number of subjects = 100.

Stage | 1 | 2 | 3 |
---|---|---|---|

Information rate | 33.3% | 66.7% | 100% |

Efficacy boundary (z-value scale) | 3.471 | 2.454 | 2.004 |

Futility boundary (z-value scale) | 1.000 | 2.000 | |

Overa |