opt_design {baskexact}R Documentation

Optimize a Basket Design

Description

Finds the optimal tuning parameters using grid search.

Usage

opt_design(design, ...)

## S4 method for signature 'OneStageBasket'
opt_design(
  design,
  n,
  alpha,
  weight_fun,
  weight_params = list(),
  globalweight_fun = NULL,
  globalweight_params = list(),
  scenarios,
  prec_digits,
  ...
)

## S4 method for signature 'TwoStageBasket'
opt_design(
  design,
  n,
  n1,
  alpha,
  interim_fun,
  interim_params = list(),
  weight_fun,
  weight_params = list(),
  globalweight_fun = NULL,
  globalweight_params = list(),
  scenarios,
  prec_digits,
  ...
)

Arguments

design

An object of class Basket created by setupOneStageBasket or setupTwoStageBasket.

...

Further arguments.

n

The sample size per basket.

alpha

The one-sided signifance level.

weight_fun

Which function should be used to calculate the pairwise weights.

weight_params

A list of tuning parameters specific to weight_fun.

globalweight_fun

Which function should be used to calculate the global weights.

globalweight_params

A list of tuning parameters specific to globalweight_fun.

scenarios

A matrix of response rate scenarios. Each column corresponds to a scenario and each row corresponds to a basket. A default scenario matrix can be created with get_scenarios.

prec_digits

Number of decimal places that are considered when adjusting lambda.

n1

The sample size per basket for the interim analysis in case of a two-stage design.

interim_fun

Which type of interim analysis should be conducted in case of a two-stage design.

interim_params

A list of tuning parameters specific to interim_fun.

Details

opt_design finds the optimal combination of tuning parameter values from a the set of tuning paramters that is passed to the function. The objective function for the optimization is the mean of the expected number of correct decisions (ECD) under the passed scenarios, with the constraint that the type 1 error under the global null hypothesis must be below alpha.

Value

A matrix with the ECDs under all scenarios and the mean ECD for all combinations of tuning parameter values. The matrix is sorted decreasingly by the mean ECD.

Methods (by class)

Examples


design <- setupOneStageBasket(k = 3, p0 = 0.2)
opt_design(design = design, n = 10, alpha = 0.05,
  weight_fun = weights_fujikawa, weight_params = list(epsilon = c(1, 2),
  tau = c(0, 0.5)), scenarios = get_scenarios(design, 0.5), prec_digits = 3)


[Package baskexact version 1.0.1 Index]