The optimization method minimize requires an initial design for optimization. The function get_initial_design provides an initial guess based on a fixed design that fulfills constraints on type I error rate and power. Note that a situation-specific initial design may be much more efficient.

get_initial_design(
  theta,
  alpha,
  beta,
  type = c("two-stage", "group-sequential", "one-stage"),
  dist = Normal(),
  order = 7L,
  ...
)

Arguments

theta

the alternative effect size in the normal case, the rate difference under the alternative in the binomial case

alpha

maximal type I error rate

beta

maximale type II error rate

type

is a two-stage, group-sequential, or one-stage design requried?

dist

distribution of the test statistic

order

desired integration order

...

further optional arguments

Details

The distribution of the test statistic is specified by dist. The default assumes a two-armed z-test.

Examples

init <- get_initial_design(
   theta = 0.3,
   alpha = 0.025,
   beta  = 0.2,
   type  = "two-stage",
   dist  = Normal(two_armed = FALSE),
   order = 7L
)