twostg_text: Two-stage design text

View source: R/stat_text.R

twostg_textR Documentation

Two-stage design text

Description

Output two-stage design text.

Usage

twostg_text(p0, pa, n1, n2, r1, r2, conf = NULL, outcome = "_OUTCOME_ (_OUT_)")

Arguments

p0, pa

the null and alternative hypotheses

n1, n2

sample size of first and second stage

r1, r2

maximum number of responses in first stage and overall where treatment is declared ineffective

conf

confidence level for single- and two-stage confidence intervals

outcome

text string describing the outcome; if a string such as "long description (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 two-stage design with attr(., "design") containing the design.

See Also

twostg_power; simon; twostg; twocon; binci

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

Examples

## basic usage (compare to a simon design)
p0 <- 0.3
pa <- 0.5
s <- as.list(desmon2:::simon(p0, pa)$designs[1L, ])

twostg_text(p0, pa, s$n1, s$n2, s$r1, s$r2)

## Not run: 
## use cat and/or strwrap for improved formatting and writing
cat(strwrap(twostg_text(p0, pa, s$n1, s$n2, s$r1, s$r2), width = 80),
    sep = '\n')

cat(twostg_text(p0, pa, s$n1, s$n2, s$r1, s$r2),
    file = '~/simon_design.txt')

cat(twostg_text(p0, pa, s$n1, s$n2, s$r1, s$r2,
                outcome = 'overall response (OR) rate'),
    file = '~/simon_design2.txt')

## End(Not run)


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