# NOT RUN {
# Define Type one error rate
toer <- expected(ConditionalPower(Normal(), PointMassPrior(0.0, 1)))
# Define Power at delta = 0.4
pow <- expected(ConditionalPower(Normal(), PointMassPrior(0.4, 1)))
# Define expected sample size at delta = 0.4
ess <- expected(ConditionalSampleSize(Normal(), PointMassPrior(0.4, 1)))
# Compute design minimizing ess subject to power and toer constraints
# }
# NOT RUN {
minimize(
ess,
subject_to(
toer <= 0.025,
pow >= 0.9
),
initial_design = TwoStageDesign(50, .0, 2.0, 60.0, 2.0, 5L)
)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab