obtainDesign {mtdesign}R Documentation

Finds optimal and minimax designs for either Simon's 2-stage or Mander & Thompson studies

Description

obtainDesign is essentially a wrapper for calls to createGrid and augmentGrid followed by some simple filtering of the candidate designs to identify the optimal and minimax designs.

Usage

obtainDesign(
  grid = NULL,
  p0 = NA,
  p1 = NA,
  alpha = ifelse(is.null(grid), 0.05, NA),
  beta = ifelse(is.null(grid), 0.1, NA),
  fullGrid = FALSE,
  ...
)

Arguments

grid

Optional. A tibble created by createGrid. If NULL, then p0, p1, alpha and beta must be specified and createGrid is called to generate the required grid. If not NULL then p0, p1, alpha and beta are ignored

p0

the response rate under the null hypothesis

p1

the response rate under the alternate hypothesis

alpha

the desired (one-sided) type 1 error rate

beta

the desired type 2 error rate

fullGrid

should the full grid of all possible designs be returned, or simply the optimal and minimax solutions? For a Mander and Thompson design, optimal and minimax designs are returned for both the null and alternate hypotheses. See Usage Notes below.

...

passed to 'createGrid' or 'augmentGrid'. In particular mander=TRUE for a Mander & Thompson design or mander=FALSE for a Simon's 2-stage design.

Value

a tibble created by createGrid. If fullGrid == FALSE the table contains an additional column, Criterion indicating the type of design. Possible values for Criterion are "optimal" and "minimax" for Simon's designs and "optimalNull", "optimalAlt", "minimaxNull" and "minimaxAlt" for Mander & Thompson designs.

Usage notes

If grid is not NULL it is possible that none of the candidate designs are acceptable (that is, satisfy both the significance level and power requirements). If this is the case and fullGrid == FALSE, then an empty tibble is returned. If versbose == TRUE a warning message is also printed. If fullGrid == TRUE the full grid of all designs considered is returned. This can then be further interrogated to find optimal designs under constraints - for example with fixed stage sizes.

Examples


# Standard use (Simon's 2-stage design)
createGrid(p0 = 0.05, p1 = 0.25, alpha = 0.05, beta = 0.2, mander = FALSE) %>%
  augmentGrid(parallel = FALSE) %>%
  obtainDesign()
# Constrained stage sizes
createGrid(p0 = 0.25, p1 = 0.45, alpha = 0.05, beta = 0.2) %>%
  dplyr::filter(nStage1 == 8) %>%
  augmentGrid(parallel = FALSE) %>%
  obtainDesign()


[Package mtdesign version 0.1.0 Index]