simulation {blindrecalc}  R Documentation 
This function simulates the probability that a test defined by
setupStudent
rejects the null hypothesis.
Note that here the nuisance parameter nuisance
is the variance
of the outcome variable sigma^2.
simulation(
design,
n1,
nuisance,
recalculation = TRUE,
delta_true,
iters = 1000,
seed = NULL,
allocation = c("approximate", "exact"),
...
)
design 
Object of class 
n1 
Either the sample size of the first stage (if

nuisance 
Value of the nuisance parameter. For the Student's ttest this is the variance. 
recalculation 
Should the sample size be recalculated after n1 n1 patients are recruited? 
delta_true 
effect measure under which the rejection probabilities are computed 
iters 
Number of simulation iterations. 
seed 
Random seed for simulation. 
allocation 
Whether the allocation ratio should be preserved
exactly ( 
... 
Further optional arguments. 
The implementation follows the algorithm in Lu (2019):
Distribution of the twosample ttest statistic following blinded
sample size reestimation.
Pharmaceutical Statistics 15: 208215.
Since Lu (2019) assumes negative noninferiority margins, the noninferiority
margin of design
is multiplied with 1 internally.
Simulated rejection probabilities and sample sizes for each nuisance parameter.
d < setupStudent(alpha = .025, beta = .2, r = 1, delta = 3.5, delta_NI = 0,
alternative = "greater", n_max = 156)
simulation(d, n1 = 20, nuisance = 5.5, recalculation = TRUE, delta_true = 3.5)