b2p_text | R Documentation |
Output two-proportion design text. The power or sample size (per group)
will be calculated depending on the arguments given (i.e., either
n1
or power
should be NULL
).
b2p_text(
p1,
p2,
n1 = NULL,
n2 = n1,
power = NULL,
alpha = 0.025,
r = 0.5,
arms = c("Experimental", "Control"),
type = c("fisher", "UMPU", "approx.cor", "approx.unc"),
cont.cor = TRUE
)
p1 , p2 |
the success rates for both groups ( |
n1 , n2 |
sample size for both groups |
power , alpha |
the power and one-sided significance level (type I error) |
r |
proportion assigned to group 1 |
arms |
labels for the two groups |
type |
the type of test used to calculate power, see
|
cont.cor |
logical; if |
A character string describing the two-stage design with
attr(., "design")
containing the design.
b2p
; b2n
Other designs:
bin1samp_text()
,
mtd_text()
,
simon_text()
,
twostg_text()
## basic usage (compare to a simon design)
p1 <- 0.5
p2 <- 0.3
b2p_text(p1, p2, power = 0.8)
b2p_text(p1, p2, n1 = 103)
b2p_text(p1, p2, power = 0.8, r = 2/3)
## Not run:
## use cat and/or strwrap for improved formatting and writing
cat(strwrap(b2p_text(p1, p2, power = 0.8), width = 80), sep = '\n')
cat(b2p_text(p1, p2, power = 0.8), file = '~/simon_design.txt')
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.