Learn R Programming

adoptr (version 0.1.1)

ConstraintsCollection-class: Collection of constraints

Description

Collection of constraints

Arguments

s

constraint collection

design

design

Slots

unconditional_constraints

a list of elements of class UnconditionalConstraint

conditional_constraints

a list of elements of class ConditionalConstraint

A ConstraintsCollection is a collection of unconditional and conditional constraints. In order to evaluate these correctly, they have to be defined in two different slots.

See Also

A ConstraintsCollection can be created by subject_to.

Examples

Run this code
# 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