simulate,TwoStageDesign,numeric-method | R Documentation |
simulate
allows to draw samples from a given
TwoStageDesign
.
## S4 method for signature 'TwoStageDesign,numeric'
simulate(object, nsim, dist, theta, seed = NULL, ...)
object |
|
nsim |
number of simulation runs |
dist |
data distribution |
theta |
location parameter of the data distribution |
seed |
random seed |
... |
further optional arguments |
simulate()
returns a data.frame
with nsim
rows and for each row (each simulation run) the following columns
theta The effect size
n1 First-stage sample size
c1f Stopping for futility boundary
c1e Stopping for efficacy boundary
x1 First-stage outcome
n2 Resulting second-stage sample size after observing x1
c2 Resulting second-stage decision-boundary after observing x1
x2 Second-stage outcome
reject Decision whether the null hypothesis is rejected or not
TwoStageDesign
design <- TwoStageDesign(25, 0, 2, 25, 2, order = 5)
# draw samples assuming two-armed design
simulate(design, 10, Normal(), .3, 42)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.