drawDiagram: drawDiagram

Description Usage Arguments Value Author(s) Examples

Description

This function produces both a data frame and a diagram of stopping boundaries. The function takes a single argument: the output from the function findDesigns. If the supplied argument contains more than one admissible designs, the user is offered a choice of which design to use.

Usage

1
2
3
4
5
6
7
drawDiagram(
  findDesign.output,
  print.row = NULL,
  save.plot = FALSE,
  xmax = NULL,
  ymax = NULL
)

Arguments

findDesign.output

Output from either the function findDesigns or findSimonDesigns.

print.row

Choose a row number to directly obtain a plot and stopping boundaries for a particular design realisation. Default is NULL.

save.plot

Logical. Set to TRUE to save plot as PDF. Default is FALSE.

xmax, ymax

Choose values for the upper limits of the x- and y-axes respectively. Helpful for comparing two design realisations. Default is NULL.

Value

The output is a list of two elements. The first, $diagram, is a ggplot2 object showing how the trial should proceed: when to to undertake an interim analysis, that is, when to check if a stopping boundary has been reached (solid colours) and what decision to make at each possible point (continue / go decision / no go decision). The second list element, $bounds.mat, is a data frame containing three columns: the number of participants at which to undertake an interim analysis (m), and the number of responses at which the trial should stop for a go decision (success) or a no go decision (fail).

Author(s)

Martin Law, martin.law@mrc-bsu.cam.ac.uk

Examples

1
2
output <- findDesigns(nmin = 20, nmax = 20, C = 1, p0 = 0.1, p1 = 0.4, power = 0.8, alpha = 0.1)
drawDiagram(output)

martinlaw/SCsinglearm documentation built on Feb. 19, 2021, 8:05 p.m.