simon_text: Simon design text

View source: R/stat_text.R

simon_textR Documentation

Simon design text

Description

Output Simon two-stage design text.

Usage

simon_text(
  p0,
  pa,
  alpha = 0.1,
  beta = 0.1,
  ...,
  conf = NULL,
  which = 1L,
  outcome = "_OUTCOME_ (_OUT_)"
)

Arguments

p0, pa

the null and alternative hypotheses

alpha, beta

the target type-I and type-II errors, passed to simon

...

additional arguments passed to simon

conf

confidence level for single- and two-stage confidence intervals

which

optional; an integer selecting the design to use if multiple are found

outcome

text string describing the outcome; if a string such as "long desc (abbr)" is given, then entire string is used in the first instance, and only the text in parens is used subsequently

Value

A character string describing the Simon design with attr(, "design") containing the designs.

See Also

simon; twostg; twocon; binci

Other designs: b2p_text(), bin1samp_text(), mtd_text(), twostg_text()

Examples

## basic usage
p0 <- 0.3
pa <- 0.5
simon_text(p0, pa)

## select a different design
simon_text(p0, pa, which = 2)

## Not run: 
## use cat and/or strwrap for improved formatting and writing
cat(strwrap(simon_text(p0, pa), width = 80), sep = '\n')

cat(simon_text(p0, pa), file = '~/simon_design.txt')

cat(simon_text(p0, pa, outcome = 'overall response (OR) rate'),
    file = '~/simon_design2.txt')

## End(Not run)


raredd/desmon2 documentation built on Feb. 9, 2023, 12:09 p.m.