---
title: "gsDesign package overview"
output: rmarkdown::html_vignette
bibliography: gsDesign.bib
nocite: |
  @JTBook, @PLWBook
vignette: >
  %\VignetteIndexEntry{gsDesign package overview}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---

```{r, include=FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  dev = "svg",
  fig.width = 7.2916667,
  fig.asp = 0.618,
  fig.align = "center",
  out.width = "80%"
)
```

## Introduction

gsDesign is a package for deriving and describing group sequential designs.
The package allows particular flexibility for designs with alpha- and
beta-spending. Many plots are available for describing design properties.

The gsDesign package supports group sequential
clinical trial design.  While there is a strong focus on designs using
$\alpha$- and $\beta$-spending functions, Wang-Tsiatis
designs, including O'Brien-Fleming and Pocock designs, are also available.
The ability to design with non-binding futility rules allows control of Type
I error in a manner acceptable to regulatory authorities when futility
bounds are employed.

The routines are designed to provide simple access to commonly used designs
using default arguments.  Standard, published spending functions are
supported as well as the ability to write custom spending functions.
A `gsDesign` class is defined and returned by the `gsDesign()`
function.  A plot function for this class provides a wide variety of plots:
boundaries, power, estimated treatment effect at boundaries, conditional
power at boundaries, spending function plots, expected sample size plot, and
B-values at boundaries. Using function calls to access the package routines
provides a powerful capability to derive designs or output formatting that
could not be anticipated through a GUI interface.  This enables the user to
easily create designs with features they desire, such as designs with
minimum expected sample size.

Thus, the intent of the gsDesign package is to easily create, fully
characterize and even optimize routine group sequential trial designs as
well as provide a tool to evaluate innovative designs.

## Example

Here is a minimal example assuming a fixed design (no interim) trial
with the same endpoint requires 200 subjects for 90% power at
$\alpha$ = 0.025, one-sided:

```{r}
library(gsDesign)

x <- gsDesign(n.fix = 200)
plot(x)
gsBoundSummary(x)
```

## References