Learn R Programming

VisualizeSimon2Stage (version 0.1.5)

autoplot.ph2simon: Plot Simon's Two-Stage Design

Description

Plot ph2simon object using ggplot2.

Usage

# S3 method for ph2simon
autoplot(object, ...)

# S3 method for ph2simon autolayer( object, type = c("minimax", "optimal", "n1", "maximax"), n1 = stop("must provide `n1`"), n = stop("must provide `n`"), r1 = stop("must provide `r1`"), r = stop("must provide `r`"), pu = stop("must provide `pu`"), pa = stop("must provide `pa`"), ... )

Value

Function autoplot.ph2simon returns a ggplot object.

Function autolayer.ph2simon returns a list of ggproto and labels.

Arguments

object

ph2simon object

...

potential parameters, currently not in use

type

character scalar, one of 'minimax', 'optimal', 'n1' and 'maximax'

n1, n

(optional) integer scalars, Stage-1 sample size \(n_1\) and total sample size \(n\). Overridden if object is given

r1, r

(optional) integer scalars, number of response in Stage-1 \(r_1\) and overall \(r\) required exclusively, i.e., passing Stage-1 means observing \(>r_1\) response. Overridden if object is given

pu, pa

double scalars, see function ph2simon

Examples

Run this code
library(clinfun)
(x = ph2simon(pu = .2, pa = .4, ep1 = .05, ep2 = .1)) 
class(x)
autoplot(x, type = 'minimax')
autoplot(x, type = 'optimal')
autoplot(x, type = 'n1')
autoplot(x, type = 'maximax')

# example with r1 = 0
(des = ph2simon(pu = .05, pa = .3, ep1 = .05, ep2 = .2))
autoplot(des, type = 'optimal')
autoplot(des, type = 'minimax')

Run the code above in your browser using DataLab