| opt_design.fujikawa_x | R Documentation |
This wrapper function returns the optimal tuning parameters for Fujikawa et al.'s basket trial design. The design is optimized using backends from two different R packages:
If design$backend == "sim", the opt_design is calculated using
basksim::opt_design.
If design$backend == "exact", the opt_design are calculated using
baskexact::opt_design.
## S3 method for class 'fujikawa_x'
opt_design(
design,
n,
alpha,
design_params = list(),
scenarios,
prec_digits,
iter = 1000,
data = NULL,
weight_fun = weights_jsd,
weight_params = design_params,
globalweight_fun = NULL,
globalweight_params = list(),
...
)
design |
An object of class |
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
|
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 |
A data matrix with k column with the number of responses for each
basket. Has to be generated with |
weight_fun |
Which functions should be used to calculated the pairwise
weights? Default is |
weight_params |
A list of tuning parameters specific to |
globalweight_fun |
Which functions should be used to calculated the global weights? Currently, this is only supported for the exact backend. |
globalweight_params |
A list of tuning parameters specific to
|
... |
Further arguments. |
A matrix with the expected number of correct decisions.
design <- setup_fujikawa_x(k = 3, p0 = 0.2)
# In an actual application, usually increase to at least iter = 1000.
opt_design(design = design,
n = 20, alpha = 0.05,
design_params = list(epsilon = c(1, 2), tau = c(0, 0.5)),
scenarios = get_scenarios(design, 0.5),
prec_digits = 3,
iter = 100)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.