opt_design {basksim}R Documentation

Optimize a Basket Trial Design

Description

Optimize a Basket Trial Design

Usage

opt_design(
  design,
  n,
  alpha,
  design_params = list(),
  scenarios,
  prec_digits,
  iter = 1000,
  data = NULL,
  ...
)

Arguments

design

An object created with one of the setup functions.

n

The sample size per basket.

alpha

The one-sided significance level.

design_params

A list of params that is specific to the class of design.

scenarios

A matrix of scenarios.

prec_digits

Number of decimal places that are considered when adjusting lambda.

iter

The number of iterations in the simulation. Is ignored if data is specified.

data

A list of data matrices generated with get_data. The list elements have to correspond to the columsn of scenarios.

...

Further arguments.

Value

A matrix with the expected number of correct decisions.

Examples

design <- setup_fujikawa(k = 3, p0 = 0.2)
scenarios <- get_scenarios(design, p1 = 0.5)

# Without simulated data
opt_design(design, n = 20, alpha = 0.05, design_params =
  list(epsilon = c(1, 2), tau = c(0, 0.5)), scenarios = scenarios,
  prec_digits = 3)

# With simulated data
scenario_list <- as.list(data.frame(scenarios))
data_list <- lapply(scenario_list,
  function(x) get_data(k = 3, n = 20, p = x, iter = 1000))
opt_design(design, n = 20, alpha = 0.05, design_params =
  list(epsilon = c(1, 2), tau = c(0, 0.5)), scenarios = scenarios,
  prec_digits = 3, data = data_list)

[Package basksim version 1.0.0 Index]