| Title: | Simulation-Based Calculation of Basket Trial Operating Characteristics |
|---|---|
| Description: | Provides a unified syntax for the simulation-based comparison of different single-stage basket trial designs with a binary endpoint and equal sample sizes in all baskets. Methods include the designs by Baumann et al. (2025) <doi:10.1080/19466315.2024.2402275>, Schmitt and Baumann (2025) <doi:10.1080/19466315.2025.2486231>, Fujikawa et al. (2020) <doi:10.1002/bimj.201800404>, Berry et al. (2020) <doi:10.1177/1740774513497539>, and Neuenschwander et al. (2016) <doi:10.1002/pst.1730>. For the latter two designs, the functions are mostly wrappers for functions provided by the package 'bhmbasket'. |
| Authors: | Lukas Baumann [aut, cre] (ORCID: <https://orcid.org/0000-0001-7931-7470>), Lukas D Sauer [aut] (ORCID: <https://orcid.org/0000-0002-1340-9994>), Sabrina Schmitt [aut] (ORCID: <https://orcid.org/0009-0008-2719-6513>) |
| Maintainer: | Lukas Baumann <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 2.2.0 |
| Built: | 2026-05-22 16:36:36 UTC |
| Source: | https://github.com/lbau7/basksim |
Adjust Lambda
adjust_lambda(design, ...)adjust_lambda(design, ...)
design |
An object created with one of the |
... |
Further arguments. |
The default method for adjust_lambda uses a combination
of uniroot and grid search and calls toer
in every iteration. For methods implemented in the bhmbasket package
there are separate methods that are computationally more efficient.
A list containing the greatest estimated value for lambda with
prec_digits decimal places which controls the family wise error rate
at level alpha (one-sided) and the estimated family wise error rate
for the estimated lambda.
design <- setup_cpp(k = 3, p0 = 0.2) # Equal sample sizes adjust_lambda(design = design, n = 20, alpha = 0.05, design_params = list(tune_a = 1, tune_b = 1), iter = 1000) # Unequal sample sizes adjust_lambda(design = design, n = c(15, 20, 25), alpha = 0.05, design_params = list(tune_a = 1, tune_b = 1), iter = 1000)design <- setup_cpp(k = 3, p0 = 0.2) # Equal sample sizes adjust_lambda(design = design, n = 20, alpha = 0.05, design_params = list(tune_a = 1, tune_b = 1), iter = 1000) # Unequal sample sizes adjust_lambda(design = design, n = c(15, 20, 25), alpha = 0.05, design_params = list(tune_a = 1, tune_b = 1), iter = 1000)
Adjust Lambda for the BHM Design
## S3 method for class 'bhm' adjust_lambda( design, n, p1 = NULL, alpha = 0.05, design_params = list(), iter = 1000, n_mcmc = 10000, prec_digits = 3, data = NULL, ... )## S3 method for class 'bhm' adjust_lambda( design, n, p1 = NULL, alpha = 0.05, design_params = list(), iter = 1000, n_mcmc = 10000, prec_digits = 3, data = NULL, ... )
design |
An object created with one of the |
n |
The sample sizes of the baskets. A vector must be used for varying sample sizes. |
p1 |
Probabilities used for the simulation. If |
alpha |
The one-sided significance level. |
design_params |
A list of params that is specific to the class of
|
iter |
The number of iterations in the simulation. Is ignored if
|
n_mcmc |
Number of MCMC samples. |
prec_digits |
Number of decimal places that are considered when adjusting lambda. |
data |
A data matrix with k column with the number of responses for each
basket. Has to be generated with |
... |
Further arguments. |
A list containing the greatest estimated value for lambda with
prec_digits decimal places which controls the family wise error rate
at level alpha (one-sided) and the estimated family wise error rate
for the estimated lambda.
design <- setup_bhm(k = 3, p0 = 0.2, p_target = 0.5) # Equal sample sizes adjust_lambda(design = design, n = 15, design_params = list(tau_scale = 1), iter = 100, n_mcmc = 5000) # Unequal sample sizes adjust_lambda(design = design, n = c(15, 20, 25), design_params = list(tau_scale = 1), iter = 100, n_mcmc = 5000)design <- setup_bhm(k = 3, p0 = 0.2, p_target = 0.5) # Equal sample sizes adjust_lambda(design = design, n = 15, design_params = list(tau_scale = 1), iter = 100, n_mcmc = 5000) # Unequal sample sizes adjust_lambda(design = design, n = c(15, 20, 25), design_params = list(tau_scale = 1), iter = 100, n_mcmc = 5000)
Adjust Lambda
## Default S3 method: adjust_lambda( design, n, p1 = NULL, alpha = 0.05, design_params = list(), iter = 1000, prec_digits = 3, data = NULL, ... )## Default S3 method: adjust_lambda( design, n, p1 = NULL, alpha = 0.05, design_params = list(), iter = 1000, prec_digits = 3, data = NULL, ... )
design |
An object created with one of the |
n |
The sample sizes of the baskets. A vector must be used for varying sample sizes. |
p1 |
Probabilities under the alternative hypothesis. If |
alpha |
The one-sided significance level. |
design_params |
A list of params that is specific to the class of
|
iter |
The number of iterations in the simulation. Is ignored if
|
prec_digits |
Number of decimal places that are considered when adjusting lambda. |
data |
A data matrix with k column with the number of responses for each
basket. Has to be generated with |
... |
Further arguments. |
It is recommended to use data and then use the same simulated
data set for all further calculations. If data = NULL then
new data are generated in each step of the algorithm, so lambda doesn't
necessarily protect the family wise error rate for different simulated data
due to Monte Carlo simulation error.
A list containing the greatest estimated value for lambda with
prec_digits decimal places which controls the family wise error rate
at level alpha (one-sided) and the estimated family wise error rate
for the estimated lambda.
# Example for a basket trial with Fujikawa's Design design <- setup_fujikawa(k = 3, p0 = 0.2) # Equal sample sizes adjust_lambda(design = design, n = 20, alpha = 0.05, design_params = list(epsilon = 2, tau = 0), iter = 1000) # Unequal sample sizes adjust_lambda(design = design, n = c(15, 20, 25), alpha = 0.05, design_params = list(epsilon = 2, tau = 0), iter = 1000)# Example for a basket trial with Fujikawa's Design design <- setup_fujikawa(k = 3, p0 = 0.2) # Equal sample sizes adjust_lambda(design = design, n = 20, alpha = 0.05, design_params = list(epsilon = 2, tau = 0), iter = 1000) # Unequal sample sizes adjust_lambda(design = design, n = c(15, 20, 25), alpha = 0.05, design_params = list(epsilon = 2, tau = 0), iter = 1000)
Adjust Lambda for the EXNEX Design
## S3 method for class 'exnex' adjust_lambda( design, n, p1 = NULL, alpha = 0.05, design_params = list(), iter = 1000, n_mcmc = 10000, prec_digits = 3, data = NULL, ... )## S3 method for class 'exnex' adjust_lambda( design, n, p1 = NULL, alpha = 0.05, design_params = list(), iter = 1000, n_mcmc = 10000, prec_digits = 3, data = NULL, ... )
design |
An object created with one of the |
n |
The sample sizes of the baskets. A vector must be used for varying sample sizes. |
p1 |
Probabilities used for the simulation. If |
alpha |
The one-sided significance level. |
design_params |
A list of params that is specific to the class of
|
iter |
The number of iterations in the simulation. Is ignored if
|
n_mcmc |
Number of MCMC samples. |
prec_digits |
Number of decimal places that are considered when adjusting lambda. |
data |
A data matrix with k column with the number of responses for each
basket. Has to be generated with |
... |
Further arguments. |
A list containing the greatest estimated value for lambda with
prec_digits decimal places which controls the family wise error rate
at level alpha (one-sided) and the estimated family wise error rate
for the estimated lambda.
design <- setup_exnex(k = 3, p0 = 0.2) # Equal sample sizes adjust_lambda(design = design, n = 15, design_params = list(tau_scale = 1, w_j = 0.5), iter = 100, n_mcmc = 5000) # Unequal sample sizes adjust_lambda(design = design, n = c(15, 20, 25), design_params = list(tau_scale = 1, w_j = 0.5), iter = 100, n_mcmc = 5000)design <- setup_exnex(k = 3, p0 = 0.2) # Equal sample sizes adjust_lambda(design = design, n = 15, design_params = list(tau_scale = 1, w_j = 0.5), iter = 100, n_mcmc = 5000) # Unequal sample sizes adjust_lambda(design = design, n = c(15, 20, 25), design_params = list(tau_scale = 1, w_j = 0.5), iter = 100, n_mcmc = 5000)
Calculate the Expected Number of Correct Decisions for a Basket Trial Design
ecd( design, n, p1, lambda, design_params = list(), iter = 1000, data = NULL, ... )ecd( design, n, p1, lambda, design_params = list(), iter = 1000, data = NULL, ... )
design |
An object created with one of the |
n |
The sample sizes of the baskets. A vector must be used for varying sample sizes. |
p1 |
Probabilities used for the simulation. If |
lambda |
The posterior probability threshold. |
design_params |
A list of params that is specific to the class of
|
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 |
... |
Further arguments. |
A numeric value.
# Example for a basket trial with Fujikawa's Design design <- setup_fujikawa(k = 3, p0 = 0.2) # Equal sample sizes ecd(design = design, n = 20, p1 = c(0.2, 0.5, 0.5), lambda = 0.95, design_params = list(epsilon = 2, tau = 0), iter = 1000) # Unequal sample sizes ecd(design = design, n = c(15, 20, 25), p1 = c(0.2, 0.5, 0.5), lambda = 0.95, design_params = list(epsilon = 2, tau = 0), iter = 1000)# Example for a basket trial with Fujikawa's Design design <- setup_fujikawa(k = 3, p0 = 0.2) # Equal sample sizes ecd(design = design, n = 20, p1 = c(0.2, 0.5, 0.5), lambda = 0.95, design_params = list(epsilon = 2, tau = 0), iter = 1000) # Unequal sample sizes ecd(design = design, n = c(15, 20, 25), p1 = c(0.2, 0.5, 0.5), lambda = 0.95, design_params = list(epsilon = 2, tau = 0), iter = 1000)
Plot a Bayesian basket trial's posterior distribution after borrowing
geom_borrow(design, ...)geom_borrow(design, ...)
design |
An object created with one of the |
... |
Further arguments to be passed to 'geom_function'. |
A list of ggplot layers of type 'geom_function'.
# Example for a basket trial with Fujikawa's Design design <- setup_fujikawa(k = 3, p0 = 0.2) n <- 20 r <- c(4, 5, 2) epsilon <- 2 tau <- 0.5 # One facet per basket library(ggplot2) ggplot() + geom_borrow(design, n, r, epsilon, tau, logbase = exp(1)) + facet_wrap(vars(basket)) # Colour different baskets ggplot() + geom_borrow(design, n, r, epsilon, tau, logbase = exp(1), aes(colour = basket))# Example for a basket trial with Fujikawa's Design design <- setup_fujikawa(k = 3, p0 = 0.2) n <- 20 r <- c(4, 5, 2) epsilon <- 2 tau <- 0.5 # One facet per basket library(ggplot2) ggplot() + geom_borrow(design, n, r, epsilon, tau, logbase = exp(1)) + facet_wrap(vars(basket)) # Colour different baskets ggplot() + geom_borrow(design, n, r, epsilon, tau, logbase = exp(1), aes(colour = basket))
Plot a Fujikawa basket trial's posterior distribution after borrowing
## S3 method for class 'fujikawa' geom_borrow(design, n, r, epsilon, tau, logbase, ...)## S3 method for class 'fujikawa' geom_borrow(design, n, r, epsilon, tau, logbase, ...)
design |
An object created with one of the |
n |
The sample sizes of the baskets. A vector must be used for varying sample sizes. |
r |
Vector of responses. |
epsilon |
Tuning parameter that determines the amount of borrowing.
See |
tau |
Tuning parameter that determines how similar the baskets
have to be that information is shared. See |
logbase |
Tuning parameter. The base of the logarithm that is used to calculate the Jensen-Shannon divergence. |
... |
Further arguments to be passed to 'geom_function'. |
A list of ggplot layers of type 'geom_function'.
# Example for a basket trial with Fujikawa's Design design <- setup_fujikawa(k = 3, p0 = 0.2) n <- 20 r <- c(4, 5, 2) epsilon <- 2 tau <- 0.5 # One facet per basket library(ggplot2) ggplot() + geom_borrow(design, n, r, epsilon, tau, logbase = exp(1)) + facet_wrap(vars(basket)) # Colour different baskets ggplot() + geom_borrow(design, n, r, epsilon, tau, logbase = exp(1), aes(colour = basket))# Example for a basket trial with Fujikawa's Design design <- setup_fujikawa(k = 3, p0 = 0.2) n <- 20 r <- c(4, 5, 2) epsilon <- 2 tau <- 0.5 # One facet per basket library(ggplot2) ggplot() + geom_borrow(design, n, r, epsilon, tau, logbase = exp(1)) + facet_wrap(vars(basket)) # Colour different baskets ggplot() + geom_borrow(design, n, r, epsilon, tau, logbase = exp(1), aes(colour = basket))
Plot a Bayesian basket trial's posterior distribution
geom_posterior(design, ...)geom_posterior(design, ...)
design |
An object created with one of the |
... |
Further arguments to be passed to 'geom_function'. |
A list of ggplot layers of type 'geom_function'.
# Example for a basket trial with Fujikawa's Design design <- setup_fujikawa(k = 3, p0 = 0.2) n <- 20 r <- c(4, 5, 2) # One facet per basket library(ggplot2) ggplot() + geom_posterior(design, n, r) + facet_wrap(vars(basket)) # Colour different baskets ggplot() + geom_posterior(design, n, r, aes(colour = basket))# Example for a basket trial with Fujikawa's Design design <- setup_fujikawa(k = 3, p0 = 0.2) n <- 20 r <- c(4, 5, 2) # One facet per basket library(ggplot2) ggplot() + geom_posterior(design, n, r) + facet_wrap(vars(basket)) # Colour different baskets ggplot() + geom_posterior(design, n, r, aes(colour = basket))
Plot a Fujikawa basket trial's posterior distribution
## S3 method for class 'fujikawa' geom_posterior(design, n, r, ...)## S3 method for class 'fujikawa' geom_posterior(design, n, r, ...)
design |
An object created with one of the |
n |
The sample sizes of the baskets. A vector must be used for varying sample sizes. |
r |
Vector of responses. |
... |
Further arguments to be passed to 'geom_function'. |
A list of ggplot layers of type 'geom_function'.
# Example for a basket trial with Fujikawa's Design design <- setup_fujikawa(k = 3, p0 = 0.2) n <- 20 r <- c(4, 5, 2) # One facet per basket library(ggplot2) ggplot() + geom_posterior(design, n, r) + facet_wrap(vars(basket)) # Colour different baskets ggplot() + geom_posterior(design, n, r, aes(colour = basket))# Example for a basket trial with Fujikawa's Design design <- setup_fujikawa(k = 3, p0 = 0.2) n <- 20 r <- c(4, 5, 2) # One facet per basket library(ggplot2) ggplot() + geom_posterior(design, n, r) + facet_wrap(vars(basket)) # Colour different baskets ggplot() + geom_posterior(design, n, r, aes(colour = basket))
Plot a Bayesian basket trial's prior distribution
geom_prior(design, ...)geom_prior(design, ...)
design |
An object created with one of the |
... |
Further arguments to be passed to 'geom_function'. |
A list of ggplot layers of type 'geom_function'.
# Example for a basket trial with Fujikawa's Design design <- setup_fujikawa(k = 3, p0 = 0.2) # One facet per basket library(ggplot2) ggplot() + geom_prior(design) + facet_wrap(vars(basket)) # Colour different baskets ggplot() + geom_prior(design, aes(colour = basket))# Example for a basket trial with Fujikawa's Design design <- setup_fujikawa(k = 3, p0 = 0.2) # One facet per basket library(ggplot2) ggplot() + geom_prior(design) + facet_wrap(vars(basket)) # Colour different baskets ggplot() + geom_prior(design, aes(colour = basket))
Plot a Fujikawa basket trial's prior distribution
## S3 method for class 'fujikawa' geom_prior(design, ...)## S3 method for class 'fujikawa' geom_prior(design, ...)
design |
An object created with one of the |
... |
Further arguments to be passed to 'geom_function'. |
A list of ggplot layers of type 'geom_function'.
# Example for a basket trial with Fujikawa's Design design <- setup_fujikawa(k = 3, p0 = 0.2) # One facet per basket library(ggplot2) ggplot() + geom_prior(design) + facet_wrap(vars(basket)) # Colour different baskets ggplot() + geom_prior(design, aes(colour = basket))# Example for a basket trial with Fujikawa's Design design <- setup_fujikawa(k = 3, p0 = 0.2) # One facet per basket library(ggplot2) ggplot() + geom_prior(design) + facet_wrap(vars(basket)) # Colour different baskets ggplot() + geom_prior(design, aes(colour = basket))
Simulate Data Based on a Binomial Distribution
get_data(k, n, p, iter, type = c("matrix", "bhmbasket"))get_data(k, n, p, iter, type = c("matrix", "bhmbasket"))
k |
The number of baskets. |
n |
The sample sizes of the baskets. A vector must be used for varying sample sizes. |
p |
Probabilities used to simulate the data |
iter |
The number of iterations in the simulation. Is ignored if
|
type |
Type of output. Use |
For type = "bhmbasket" this is simply a wraper for
bhmbasket::simulateScenarios.
If type = "matrix" then a matrix is returned, if
type = "bhmbasket" then an element with class scenario_list.
# Equal sample sizes get_data(k = 3, n = 20, p = c(0.2, 0.2, 0.5), iter = 1000, type = "matrix") # Unequal sample sizes get_data(k = 3, n = c(15, 20, 25), p = c(0.2, 0.2, 0.5), iter = 1000, type = "matrix")# Equal sample sizes get_data(k = 3, n = 20, p = c(0.2, 0.2, 0.5), iter = 1000, type = "matrix") # Unequal sample sizes get_data(k = 3, n = c(15, 20, 25), p = c(0.2, 0.2, 0.5), iter = 1000, type = "matrix")
Get Details of a Basket Trial Simulation
get_details(design, ...)get_details(design, ...)
design |
An object created with one of the |
... |
Further arguments. |
A list containing the rejection probabilities, posterior means, mean squared errors of all baskets and the family-wise error rate. For some methods the mean limits of HDI intervals are also returned.
# Example for a basket trial with Fujikawa's Design design <- setup_fujikawa(k = 3, p0 = 0.2) # Equal sample sizes get_details(design = design, n = 20, p1 = c(0.2, 0.5, 0.5), lambda = 0.95, epsilon = 2, tau = 0, iter = 100) # Unequal sample sizes get_details(design = design, n = c(15, 20, 25), p1 = c(0.2, 0.5, 0.5), lambda = 0.95, epsilon = 2, tau = 0, iter = 100)# Example for a basket trial with Fujikawa's Design design <- setup_fujikawa(k = 3, p0 = 0.2) # Equal sample sizes get_details(design = design, n = 20, p1 = c(0.2, 0.5, 0.5), lambda = 0.95, epsilon = 2, tau = 0, iter = 100) # Unequal sample sizes get_details(design = design, n = c(15, 20, 25), p1 = c(0.2, 0.5, 0.5), lambda = 0.95, epsilon = 2, tau = 0, iter = 100)
Get Details of a Basket Trial Simulation with the Adaptive Power Prior Design for sequential clinical trials
## S3 method for class 'app' get_details( design, n, p1 = NULL, lambda, level = 0.95, iter = 1000, data = NULL, ... )## S3 method for class 'app' get_details( design, n, p1 = NULL, lambda, level = 0.95, iter = 1000, data = NULL, ... )
design |
An object of class |
n |
The sample sizes of the baskets. A vector must be used for varying sample sizes. |
p1 |
Probabilities used for the simulation. If |
lambda |
The posterior probability threshold. |
level |
Level of the credibility intervals. |
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 |
... |
Further arguments. |
A list containing the rejection probabilities, posterior means, mean squared errors and mean limits of HDI intervals for all baskets as well as the family-wise error rate.
design <- setup_app(k = 3, p0 = 0.2) # Equal sample sizes get_details(design = design, n = 20, p1 = c(0.2, 0.5, 0.5), lambda = 0.95, iter = 100) # Unequal sample sizes get_details(design = design, n = c(15, 20, 25), p1 = c(0.2, 0.5, 0.5), lambda = 0.95, iter = 100)design <- setup_app(k = 3, p0 = 0.2) # Equal sample sizes get_details(design = design, n = 20, p1 = c(0.2, 0.5, 0.5), lambda = 0.95, iter = 100) # Unequal sample sizes get_details(design = design, n = c(15, 20, 25), p1 = c(0.2, 0.5, 0.5), lambda = 0.95, iter = 100)
Get Details of a BHM Basket Trial Simulation
## S3 method for class 'bhm' get_details( design, n, p1 = NULL, lambda, level = 0.95, tau_scale, iter = 1000, n_mcmc = 10000, data = NULL, ... )## S3 method for class 'bhm' get_details( design, n, p1 = NULL, lambda, level = 0.95, tau_scale, iter = 1000, n_mcmc = 10000, data = NULL, ... )
design |
An object of class |
n |
The sample sizes of the baskets. A vector must be used for varying sample sizes. |
p1 |
Probabilities used for the simulation. If |
lambda |
The posterior probability threshold. |
level |
Level of the credibility intervals. |
tau_scale |
Standard deviation of the half normal prior distribution for the variance of the thetas. |
iter |
The number of iterations in the simulation. Is ignored if
|
n_mcmc |
Number of MCMC samples. |
data |
An object of class |
... |
Further arguments. |
A list containing the rejection probabilities, posterior means, mean squared errors and mean limits of HDI intervals for all baskets as well as the family-wise error rate.
design <- setup_bhm(k = 3, p0 = 0.2, p_target = 0.5) # Equal sample sizes get_details(design = design, n = 20, p1 = c(0.2, 0.5, 0.5), lambda = 0.95, tau_scale = 1, iter = 100) # Unequal sample sizes get_details(design = design, n = c(15, 20, 25), p1 = c(0.2, 0.5, 0.5), lambda = 0.95, tau_scale = 1, iter = 100)design <- setup_bhm(k = 3, p0 = 0.2, p_target = 0.5) # Equal sample sizes get_details(design = design, n = 20, p1 = c(0.2, 0.5, 0.5), lambda = 0.95, tau_scale = 1, iter = 100) # Unequal sample sizes get_details(design = design, n = c(15, 20, 25), p1 = c(0.2, 0.5, 0.5), lambda = 0.95, tau_scale = 1, iter = 100)
This basic frequentist design conducts a separate binomial test for each basket. All tests are one-sided, and the alternative is greater than the null hypothesis. These details are calculated exactly, not simulated.
## S3 method for class 'binomial' get_details(design, n, p1 = NULL, alpha = 0.025, ...)## S3 method for class 'binomial' get_details(design, n, p1 = NULL, alpha = 0.025, ...)
design |
An object of class |
n |
The sample sizes of the baskets. A vector must be used for varying sample sizes. |
p1 |
Probabilities used for the simulation. If |
alpha |
The one-sided significance level. |
... |
Further arguments. |
A list containing the rejection probabilities, critical values
and expected number of correct decisions. Critical values are defined
so that the null hypothesis is rejected if the observed number of responses
is greater than , i.e. rejects .
The nominal FWER is the (theoretical) FWER of a multiple testing problem
with k hypothesis tests at significance level . The actual FWER is
usually lower than the nominal FWER, as the binomial test does not exhaust
its significance level.
design <- setup_binomial(k = 3, p0 = 0.2) p1 <- c(0.2, 0.5, 0.5) get_details(design = design, n = 20, p1 = p1)design <- setup_binomial(k = 3, p0 = 0.2) p1 <- c(0.2, 0.5, 0.5) get_details(design = design, n = 20, p1 = p1)
Get Details of a Basket Trial Simulation with the Calibrated Power Prior Design
## S3 method for class 'cpp' get_details( design, n, p1 = NULL, lambda, level = 0.95, tune_a, tune_b, iter = 1000, data = NULL, ... )## S3 method for class 'cpp' get_details( design, n, p1 = NULL, lambda, level = 0.95, tune_a, tune_b, iter = 1000, data = NULL, ... )
design |
An object of class |
n |
The sample sizes of the baskets. A vector must be used for varying sample sizes. |
p1 |
Probabilities used for the simulation. If |
lambda |
The posterior probability threshold. |
level |
Level of the credibility intervals. |
tune_a |
First tuning parameter that determines the amount of borrowing based on pairwise similarity between baskets. |
tune_b |
Second tuning parameter that determines the amount of borrowing based on pairwise similarity between baskets. |
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 |
... |
Further arguments. |
A list containing the rejection probabilities, posterior means, mean squared errors and mean limits of HDI intervals for all baskets as well as the family-wise error rate.
design <- setup_cpp(k = 3, p0 = 0.2) # Equal sample sizes get_details(design = design, n = 20, p1 = c(0.2, 0.5, 0.5), lambda = 0.95, tune_a = 1, tune_b = 1, iter = 100) # Unequal sample sizes get_details(design = design, n = c(15, 20, 25), p1 = c(0.2, 0.5, 0.5), lambda = 0.95, tune_a = 1, tune_b = 1, iter = 100)design <- setup_cpp(k = 3, p0 = 0.2) # Equal sample sizes get_details(design = design, n = 20, p1 = c(0.2, 0.5, 0.5), lambda = 0.95, tune_a = 1, tune_b = 1, iter = 100) # Unequal sample sizes get_details(design = design, n = c(15, 20, 25), p1 = c(0.2, 0.5, 0.5), lambda = 0.95, tune_a = 1, tune_b = 1, iter = 100)
Get Details of a Basket Trial Simulation with the Global Calibrated Power Prior Design
## S3 method for class 'cppglobal' get_details( design, n, p1 = NULL, lambda, level = 0.95, tune_a, tune_b, epsilon, iter = 1000, data = NULL, ... )## S3 method for class 'cppglobal' get_details( design, n, p1 = NULL, lambda, level = 0.95, tune_a, tune_b, epsilon, iter = 1000, data = NULL, ... )
design |
An object of class |
n |
The sample sizes of the baskets. A vector must be used for varying sample sizes. |
p1 |
Probabilities used for the simulation. If |
lambda |
The posterior probability threshold. |
level |
Level of the credibility intervals. |
tune_a |
First tuning parameter that determines the amount of borrowing based on pairwise similarity between baskets. |
tune_b |
Second tuning parameter that determines the amount of borrowing based on pairwise similarity between baskets. |
epsilon |
Tuning parameter that determines the amount of borrowing based on overall heterogeneity. |
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 |
... |
Further arguments. |
A list containing the rejection probabilities, posterior means, mean squared errors and mean limits of HDI intervals for all baskets as well as the family-wise error rate.
design <- setup_cppglobal(k = 3, p0 = 0.2) get_details(design = design, n = 20, p1 = c(0.2, 0.5, 0.5), lambda = 0.95, tune_a = 1, tune_b = 1, epsilon = 2, iter = 100)design <- setup_cppglobal(k = 3, p0 = 0.2) get_details(design = design, n = 20, p1 = c(0.2, 0.5, 0.5), lambda = 0.95, tune_a = 1, tune_b = 1, epsilon = 2, iter = 100)
Get Details of a Basket Trial Simulation with the Limited Calibrated Power Prior Design
## S3 method for class 'cpplim' get_details( design, n, p1 = NULL, lambda, level = 0.95, tune_a, tune_b, iter = 1000, data = NULL, ... )## S3 method for class 'cpplim' get_details( design, n, p1 = NULL, lambda, level = 0.95, tune_a, tune_b, iter = 1000, data = NULL, ... )
design |
An object of class |
n |
The sample sizes of the baskets. A vector must be used for varying sample sizes. |
p1 |
Probabilities used for the simulation. If |
lambda |
The posterior probability threshold. |
level |
Level of the credibility intervals. |
tune_a |
First tuning parameter that determines the amount of borrowing based on pairwise similarity between baskets. |
tune_b |
Second tuning parameter that determines the amount of borrowing based on pairwise similarity between baskets. |
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 |
... |
Further arguments. |
A list containing the rejection probabilities, posterior means, mean squared errors and mean limits of HDI intervals for all baskets as well as the family-wise error rate.
design <- setup_cpplim(k = 3, p0 = 0.2) # Equal sample sizes get_details(design = design, n = 20, p1 = c(0.2, 0.5, 0.5), lambda = 0.95, tune_a = 1, tune_b = 1, iter = 100) # Unequal sample sizes get_details(design = design, n = c(15, 20, 25), p1 = c(0.2, 0.5, 0.5), lambda = 0.95, tune_a = 1, tune_b = 1, iter = 100)design <- setup_cpplim(k = 3, p0 = 0.2) # Equal sample sizes get_details(design = design, n = 20, p1 = c(0.2, 0.5, 0.5), lambda = 0.95, tune_a = 1, tune_b = 1, iter = 100) # Unequal sample sizes get_details(design = design, n = c(15, 20, 25), p1 = c(0.2, 0.5, 0.5), lambda = 0.95, tune_a = 1, tune_b = 1, iter = 100)
Get Details of a Basket Trial Simulation with the EXNEX Design
## S3 method for class 'exnex' get_details( design, n, p1 = NULL, lambda, level = 0.95, tau_scale, w_j, iter = 1000, n_mcmc = 10000, data = NULL, ... )## S3 method for class 'exnex' get_details( design, n, p1 = NULL, lambda, level = 0.95, tau_scale, w_j, iter = 1000, n_mcmc = 10000, data = NULL, ... )
design |
An object of class |
n |
The sample sizes of the baskets. A vector must be used for varying sample sizes. |
p1 |
Probabilities used for the simulation. If |
lambda |
The posterior probability threshold. |
level |
Level of the credibility intervals. |
tau_scale |
Standard deviation of the half normal prior exchangeability distribution for the variance of the thetas. |
w_j |
Fixed prior weight for the exchangeability part of the model. |
iter |
The number of iterations in the simulation. Is ignored if
|
n_mcmc |
Number of MCMC samples. |
data |
An object of class |
... |
Further arguments. |
A list containing the rejection probabilities, posterior means, mean squared errors and mean limits of HDI intervals for all baskets as well as the family-wise error rate.
design <- setup_exnex(k = 3, p0 = 0.2) # Equal sample sizes get_details(design = design, n = 20, p1 = c(0.2, 0.5, 0.5), lambda = 0.95, tau_scale = 1, w_j = 0.5, iter = 100) # Unequal sample sizes get_details(design = design, n = c(15, 20, 25), p1 = c(0.2, 0.5, 0.5), lambda = 0.95, tau_scale = 1, w_j = 0.5, iter = 100)design <- setup_exnex(k = 3, p0 = 0.2) # Equal sample sizes get_details(design = design, n = 20, p1 = c(0.2, 0.5, 0.5), lambda = 0.95, tau_scale = 1, w_j = 0.5, iter = 100) # Unequal sample sizes get_details(design = design, n = c(15, 20, 25), p1 = c(0.2, 0.5, 0.5), lambda = 0.95, tau_scale = 1, w_j = 0.5, iter = 100)
Get Details of a Basket Trial Simulation with Fujikawa's Design
## S3 method for class 'fujikawa' get_details( design, n, p1 = NULL, lambda, level = 0.95, epsilon, tau, logbase = 2, iter = 1000, data = NULL, use_future = FALSE, weight_fun = NULL, weight_params = list(epsilon = epsilon, tau = tau, logbase = logbase), ... )## S3 method for class 'fujikawa' get_details( design, n, p1 = NULL, lambda, level = 0.95, epsilon, tau, logbase = 2, iter = 1000, data = NULL, use_future = FALSE, weight_fun = NULL, weight_params = list(epsilon = epsilon, tau = tau, logbase = logbase), ... )
design |
An object of class |
n |
The sample sizes of the baskets. A vector must be used for varying sample sizes. |
p1 |
Probabilities used for the simulation. If |
lambda |
The posterior probability threshold. |
level |
Level of the credibility intervals. |
epsilon |
Tuning parameter that determines the amount of borrowing.
See |
tau |
Tuning parameter that determines how similar the baskets
have to be that information is shared. See |
logbase |
Tuning parameter. The base of the logarithm that is used to calculate the Jensen-Shannon divergence. |
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 |
use_future |
A logical, should |
weight_fun |
A function of the form |
weight_params |
A named list of input parameters (additional to |
... |
Further arguments. |
A list containing the rejection probabilities, posterior means, mean squared errors and mean limits of HDI intervals for all baskets as well as the family-wise error rate and the experiment-wise power.
design <- setup_fujikawa(k = 3, p0 = 0.2) # Equal sample sizes get_details(design = design, n = 20, p1 = c(0.2, 0.5, 0.5), lambda = 0.95, epsilon = 2, tau = 0, iter = 100) # Unequal sample sizes get_details(design = design, n = c(15, 20, 25), p1 = c(0.2, 0.5, 0.5), lambda = 0.95, epsilon = 2, tau = 0, iter = 100) # A custom weight function can be defined, e.g. weight_noshare <- function(design, n, epsilon, tau, logbase){ n_sum <- n + 1 return(diag(n_sum)) } get_details(design = design, n = 20, p1 = c(0.2, 0.5, 0.5), lambda = 0.95, epsilon = 2, tau = 0, iter = 1000, weight_fun = weight_noshare)design <- setup_fujikawa(k = 3, p0 = 0.2) # Equal sample sizes get_details(design = design, n = 20, p1 = c(0.2, 0.5, 0.5), lambda = 0.95, epsilon = 2, tau = 0, iter = 100) # Unequal sample sizes get_details(design = design, n = c(15, 20, 25), p1 = c(0.2, 0.5, 0.5), lambda = 0.95, epsilon = 2, tau = 0, iter = 100) # A custom weight function can be defined, e.g. weight_noshare <- function(design, n, epsilon, tau, logbase){ n_sum <- n + 1 return(diag(n_sum)) } get_details(design = design, n = 20, p1 = c(0.2, 0.5, 0.5), lambda = 0.95, epsilon = 2, tau = 0, iter = 1000, weight_fun = weight_noshare)
Get Details of a Basket Trial Simulation with the Power Prior Design Based on Global JSD Weights
## S3 method for class 'jsdglobal' get_details( design, n, p1 = NULL, lambda, level = 0.95, eps_pair, tau = 0, eps_all, logbase = 2, iter = 1000, data = NULL, ... )## S3 method for class 'jsdglobal' get_details( design, n, p1 = NULL, lambda, level = 0.95, eps_pair, tau = 0, eps_all, logbase = 2, iter = 1000, data = NULL, ... )
design |
An object of class |
n |
The sample sizes of the baskets. A vector must be used for varying sample sizes. |
p1 |
Probabilities used for the simulation. If |
lambda |
The posterior probability threshold. |
level |
Level of the credibility intervals. |
eps_pair |
Tuning parameter that determines the amount of borrowing based on pairwise similarity. |
tau |
Tuning parameter that determines how similar the baskets have to be that information is shared. |
eps_all |
Tuning parameter that determines the amount of borrowing based on overall heterogeneity. |
logbase |
Tuning parameter. The base of the logarithm that is used to calculate the Jensen-Shannon divergence. |
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 |
... |
Further arguments. |
A list containing the rejection probabilities, posterior means, mean squared errors and mean limits of HDI intervals for all baskets as well as the family-wise error rate.
design <- setup_jsdglobal(k = 3, p0 = 0.2) get_details(design = design, n = 20, p1 = c(0.2, 0.5, 0.5), lambda = 0.95, eps_pair = 2, eps_all = 2, iter = 100)design <- setup_jsdglobal(k = 3, p0 = 0.2) get_details(design = design, n = 20, p1 = c(0.2, 0.5, 0.5), lambda = 0.95, eps_pair = 2, eps_all = 2, iter = 100)
Get Details of a Basket Trial Simulation with the MML Design
## S3 method for class 'mml' get_details( design, n, p1 = NULL, lambda, level = 0.95, iter = 1000, data = NULL, ... )## S3 method for class 'mml' get_details( design, n, p1 = NULL, lambda, level = 0.95, iter = 1000, data = NULL, ... )
design |
An object of class |
n |
The sample sizes of the baskets. A vector must be used for varying sample sizes. |
p1 |
Probabilities used for the simulation. If |
lambda |
The posterior probability threshold. |
level |
Level of the credibility intervals. |
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 |
... |
Further arguments. |
A list containing the rejection probabilities, posterior means, mean squared errors and mean limits of HDI intervals for all baskets as well as the family-wise error rate.
design <- setup_mml(k = 3, p0 = 0.2) get_details(design = design, n = 20, p1 = c(0.2, 0.5, 0.5), lambda = 0.95, tune_a = 1, tune_b = 1, iter = 100)design <- setup_mml(k = 3, p0 = 0.2) get_details(design = design, n = 20, p1 = c(0.2, 0.5, 0.5), lambda = 0.95, tune_a = 1, tune_b = 1, iter = 100)
Get Details of a Basket Trial Simulation with the Global MML Design
## S3 method for class 'mmlglobal' get_details( design, n, p1 = NULL, lambda, level = 0.95, iter = 1000, data = NULL, ... )## S3 method for class 'mmlglobal' get_details( design, n, p1 = NULL, lambda, level = 0.95, iter = 1000, data = NULL, ... )
design |
An object of class |
n |
The sample sizes of the baskets. A vector must be used for varying sample sizes. |
p1 |
Probabilities used for the simulation. If |
lambda |
The posterior probability threshold. |
level |
Level of the credibility intervals. |
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 |
... |
Further arguments. |
A list containing the rejection probabilities, posterior means, mean squared errors and mean limits of HDI intervals for all baskets as well as the family-wise error rate.
design <- setup_mmlglobal(k = 3, p0 = 0.2) get_details(design = design, n = 20, p1 = 0.5, lambda = 0.95, iter = 100)design <- setup_mmlglobal(k = 3, p0 = 0.2) get_details(design = design, n = 20, p1 = 0.5, lambda = 0.95, iter = 100)
Evaluate a Basket Trial
get_evaluation(design, ...)get_evaluation(design, ...)
design |
An object created with one of the |
... |
Further arguments. |
A list containing the point estimates of the basket-specific response rates and, for some methods, the posterior probabilities that the estimated response rates are above a specified threshold p0.
# Example for a basket trial with Fujikawa's Design design <- setup_fujikawa(k = 3, p0 = 0.2) # Equal sample sizes get_evaluation(design = design, n = 20, r = c(10, 15, 5), lambda = 0.95, epsilon = 2, tau = 0, iter = 100) # Unequal sample sizes get_evaluation(design = design, n = c(15, 20, 25), r = c(10, 15, 17), lambda = 0.95, epsilon = 2, tau = 0, iter = 100)# Example for a basket trial with Fujikawa's Design design <- setup_fujikawa(k = 3, p0 = 0.2) # Equal sample sizes get_evaluation(design = design, n = 20, r = c(10, 15, 5), lambda = 0.95, epsilon = 2, tau = 0, iter = 100) # Unequal sample sizes get_evaluation(design = design, n = c(15, 20, 25), r = c(10, 15, 17), lambda = 0.95, epsilon = 2, tau = 0, iter = 100)
Evaluate a Basket Trial with the Adaptive Power Prior Design for sequential clinical trials
## S3 method for class 'app' get_evaluation(design, n, r, lambda, level = 0.95, ...)## S3 method for class 'app' get_evaluation(design, n, r, lambda, level = 0.95, ...)
design |
An object of class |
n |
The sample sizes of the baskets. A vector must be used for varying sample sizes. |
r |
Vector of responses. |
lambda |
The posterior probability threshold. |
level |
Level of the credibility intervals. |
... |
Further arguments. |
A list containing the point estimates of the basket-specific response rates and the posterior probabilities that the estimated response rates are above a specified threshold p0.
design <- setup_app(k = 3, p0 = 0.2) # Equal sample sizes get_evaluation(design = design, n = 20, r = c(10, 15, 5), lambda = 0.95, iter = 100) # Unequal sample sizes get_evaluation(design = design, n = c(15, 20, 25), r = c(10, 15, 17), lambda = 0.95, iter = 100)design <- setup_app(k = 3, p0 = 0.2) # Equal sample sizes get_evaluation(design = design, n = 20, r = c(10, 15, 5), lambda = 0.95, iter = 100) # Unequal sample sizes get_evaluation(design = design, n = c(15, 20, 25), r = c(10, 15, 17), lambda = 0.95, iter = 100)
Evaluate a BHM Basket Trial
## S3 method for class 'bhm' get_evaluation( design, n, r, lambda, level = 0.95, tau_scale, n_mcmc = 10000, ... )## S3 method for class 'bhm' get_evaluation( design, n, r, lambda, level = 0.95, tau_scale, n_mcmc = 10000, ... )
design |
An object of class |
n |
The sample sizes of the baskets. A vector must be used for varying sample sizes. |
r |
Vector of responses. |
lambda |
The posterior probability threshold. |
level |
Level of the credibility intervals. |
tau_scale |
Standard deviation of the half normal prior distribution for the variance of the thetas. |
n_mcmc |
Number of MCMC samples. |
... |
Further arguments. |
A list containing the point estimates of the basket-specific response rates.
design <- setup_bhm(k = 3, p0 = 0.2, p_target = 0.5) get_evaluation(design = design, n = c(20, 20, 20), r = c(10, 15, 5), lambda = 0.95, tau_scale = 1, iter = 100) # Unequal sample sizes get_evaluation(design = design, n = c(15, 20, 25), r = c(10, 15, 17), lambda = 0.95, tau_scale = 1, iter = 100)design <- setup_bhm(k = 3, p0 = 0.2, p_target = 0.5) get_evaluation(design = design, n = c(20, 20, 20), r = c(10, 15, 5), lambda = 0.95, tau_scale = 1, iter = 100) # Unequal sample sizes get_evaluation(design = design, n = c(15, 20, 25), r = c(10, 15, 17), lambda = 0.95, tau_scale = 1, iter = 100)
Evaluate a Basket Trial with the Calibrated Power Prior Design
## S3 method for class 'cpp' get_evaluation(design, n, r, lambda, level = 0.95, tune_a, tune_b, ...)## S3 method for class 'cpp' get_evaluation(design, n, r, lambda, level = 0.95, tune_a, tune_b, ...)
design |
An object of class |
n |
The sample sizes of the baskets. A vector must be used for varying sample sizes. |
r |
Vector of responses. |
lambda |
The posterior probability threshold. |
level |
Level of the credibility intervals. |
tune_a |
First tuning parameter that determines the amount of borrowing based on pairwise similarity between baskets. |
tune_b |
Second tuning parameter that determines the amount of borrowing based on pairwise similarity between baskets. |
... |
Further arguments. |
A list containing the point estimates of the basket-specific response rates and the posterior probabilities that the estimated response rates are above a specified threshold p0.
design <- setup_cpp(k = 3, p0 = 0.2) # Equal sample sizes get_evaluation(design = design, n = 20, r = c(10, 15, 5), lambda = 0.95, tune_a = 1, tune_b = 1, iter = 100) # Unequal sample sizes get_evaluation(design = design, n = c(15, 20, 25), r = c(10, 15, 17), lambda = 0.95, tune_a = 1, tune_b = 1, iter = 100)design <- setup_cpp(k = 3, p0 = 0.2) # Equal sample sizes get_evaluation(design = design, n = 20, r = c(10, 15, 5), lambda = 0.95, tune_a = 1, tune_b = 1, iter = 100) # Unequal sample sizes get_evaluation(design = design, n = c(15, 20, 25), r = c(10, 15, 17), lambda = 0.95, tune_a = 1, tune_b = 1, iter = 100)
Evaluate a Basket Trial with the Limited Calibrated Power Prior Design
## S3 method for class 'cpplim' get_evaluation(design, n, r, lambda, level = 0.95, tune_a, tune_b, ...)## S3 method for class 'cpplim' get_evaluation(design, n, r, lambda, level = 0.95, tune_a, tune_b, ...)
design |
An object of class |
n |
The sample sizes of the baskets. A vector must be used for varying sample sizes. |
r |
Vector of responses. |
lambda |
The posterior probability threshold. |
level |
Level of the credibility intervals. |
tune_a |
First tuning parameter that determines the amount of borrowing based on pairwise similarity between baskets. |
tune_b |
Second tuning parameter that determines the amount of borrowing based on pairwise similarity between baskets. |
... |
Further arguments. |
A list containing the point estimates of the basket-specific response rates and the posterior probabilities that the estimated response rates are above a specified threshold p0.
design <- setup_cpplim(k = 3, p0 = 0.2) # Equal sample sizes get_evaluation(design = design, n = 20, r = c(10, 15, 5), lambda = 0.95, tune_a = 1, tune_b = 1, iter = 100) # Unequal sample sizes get_evaluation(design = design, n = c(15, 20, 25), r = c(10, 15, 17), lambda = 0.95, tune_a = 1, tune_b = 1, iter = 100)design <- setup_cpplim(k = 3, p0 = 0.2) # Equal sample sizes get_evaluation(design = design, n = 20, r = c(10, 15, 5), lambda = 0.95, tune_a = 1, tune_b = 1, iter = 100) # Unequal sample sizes get_evaluation(design = design, n = c(15, 20, 25), r = c(10, 15, 17), lambda = 0.95, tune_a = 1, tune_b = 1, iter = 100)
Evaluate a Basket Trial with the EXNEX Design
## S3 method for class 'exnex' get_evaluation( design, n, r, lambda, level = 0.95, tau_scale, w_j, n_mcmc = 10000, ... )## S3 method for class 'exnex' get_evaluation( design, n, r, lambda, level = 0.95, tau_scale, w_j, n_mcmc = 10000, ... )
design |
An object of class |
n |
The sample sizes of the baskets. A vector must be used for varying sample sizes. |
r |
Vector of responses. |
lambda |
The posterior probability threshold. |
level |
Level of the credibility intervals. |
tau_scale |
Standard deviation of the half normal prior exchangeability distribution for the variance of the thetas. |
w_j |
Fixed prior weight for the exchangeability part of the model. |
n_mcmc |
Number of MCMC samples. |
... |
Further arguments. |
A list containing the point estimates of the basket-specific response rates.
design <- setup_exnex(k = 3, p0 = 0.2) # Equal sample sizes get_evaluation(design = design, n = c(20, 20, 20), r = c(10, 15, 5), lambda = 0.95, tau_scale = 1, w_j = 0.5, iter = 100) # Unequal sample sizes get_evaluation(design = design, n = c(15, 20, 25), r = c(10, 15, 17), lambda = 0.95, tau_scale = 1, w_j = 0.5, iter = 100)design <- setup_exnex(k = 3, p0 = 0.2) # Equal sample sizes get_evaluation(design = design, n = c(20, 20, 20), r = c(10, 15, 5), lambda = 0.95, tau_scale = 1, w_j = 0.5, iter = 100) # Unequal sample sizes get_evaluation(design = design, n = c(15, 20, 25), r = c(10, 15, 17), lambda = 0.95, tau_scale = 1, w_j = 0.5, iter = 100)
Evaluate a Basket Trial with Fujikawa's Design
## S3 method for class 'fujikawa' get_evaluation( design, n, r, lambda, level = 0.95, epsilon, tau, logbase = 2, ... )## S3 method for class 'fujikawa' get_evaluation( design, n, r, lambda, level = 0.95, epsilon, tau, logbase = 2, ... )
design |
An object of class |
n |
The sample sizes of the baskets. A vector must be used for varying sample sizes. |
r |
Vector of responses. |
lambda |
The posterior probability threshold. |
level |
Level of the credibility intervals. |
epsilon |
Tuning parameter that determines the amount of borrowing.
See |
tau |
Tuning parameter that determines how similar the baskets
have to be that information is shared. See |
logbase |
Tuning parameter. The base of the logarithm that is used to calculate the Jensen-Shannon divergence. |
... |
Further arguments. |
A list containing the point estimates of the basket-specific response rates and the posterior probabilities that the estimated response rates are above a specified threshold p0.
design <- setup_fujikawa(k = 3, p0 = 0.2) # Equal sample sizes get_evaluation(design = design, n = 20, r = c(10, 15, 5), lambda = 0.95, epsilon = 2, tau = 0, iter = 100) # Unequal sample sizes get_evaluation(design = design, n = c(15, 20, 25), r = c(10, 15, 17), lambda = 0.95, epsilon = 2, tau = 0, iter = 100)design <- setup_fujikawa(k = 3, p0 = 0.2) # Equal sample sizes get_evaluation(design = design, n = 20, r = c(10, 15, 5), lambda = 0.95, epsilon = 2, tau = 0, iter = 100) # Unequal sample sizes get_evaluation(design = design, n = c(15, 20, 25), r = c(10, 15, 17), lambda = 0.95, epsilon = 2, tau = 0, iter = 100)
Get Results for Simulation of Basket Trial Designs
get_results(design, ...)get_results(design, ...)
design |
An object created with one of the |
... |
Further arguments. |
A matrix of results with iter rows. A 0 means, that the
null hypothesis that the response probability exceeds p0 was not
rejected, a 1 means, that the null hypothesis was rejected.
# Example for a basket trial with Fujikawa's Design design <- setup_fujikawa(k = 3, p0 = 0.2) # Equal sample sizes get_results(design = design, n = 20, p1 = c(0.2, 0.5, 0.5), lambda = 0.95, epsilon = 2, tau = 0, iter = 100) # Unequal sample sizes get_results(design = design, n = c(15, 20, 25), p1 = c(0.2, 0.5, 0.5), lambda = 0.95, epsilon = 2, tau = 0, iter = 100)# Example for a basket trial with Fujikawa's Design design <- setup_fujikawa(k = 3, p0 = 0.2) # Equal sample sizes get_results(design = design, n = 20, p1 = c(0.2, 0.5, 0.5), lambda = 0.95, epsilon = 2, tau = 0, iter = 100) # Unequal sample sizes get_results(design = design, n = c(15, 20, 25), p1 = c(0.2, 0.5, 0.5), lambda = 0.95, epsilon = 2, tau = 0, iter = 100)
Get Results for Simulation of a Basket Trial with Adaptive Power Prior Design
## S3 method for class 'app' get_results(design, n, p1 = NULL, lambda, iter = 1000, data = NULL, ...)## S3 method for class 'app' get_results(design, n, p1 = NULL, lambda, iter = 1000, data = NULL, ...)
design |
An object of class |
n |
The sample sizes of the baskets. A vector must be used for varying sample sizes. |
p1 |
Probabilities used for the simulation. If |
lambda |
The posterior probability threshold. |
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 |
... |
Further arguments. |
A matrix of results with iter rows. A 0 means, that the
null hypothesis that the response probability exceeds p0 was not
rejected, a 1 means, that the null hypothesis was rejected.
design <- setup_app(k = 3, p0 = 0.2) # Equal sample sizes get_results(design = design, n = 20, p1 = c(0.2, 0.5, 0.5), lambda = 0.95, iter = 100) # Unequal sample sizes get_results(design = design, n = c(15, 20, 25), p1 = c(0.2, 0.5, 0.5), lambda = 0.95, iter = 100)design <- setup_app(k = 3, p0 = 0.2) # Equal sample sizes get_results(design = design, n = 20, p1 = c(0.2, 0.5, 0.5), lambda = 0.95, iter = 100) # Unequal sample sizes get_results(design = design, n = c(15, 20, 25), p1 = c(0.2, 0.5, 0.5), lambda = 0.95, iter = 100)
Get Results for Simulation of a Basket Trial with the BHM Design
## S3 method for class 'bhm' get_results( design, n, p1 = NULL, lambda, tau_scale, iter = 1000, n_mcmc = 10000, data = NULL, ... )## S3 method for class 'bhm' get_results( design, n, p1 = NULL, lambda, tau_scale, iter = 1000, n_mcmc = 10000, data = NULL, ... )
design |
An object of class |
n |
The sample sizes of the baskets. A vector must be used for varying sample sizes. |
p1 |
Probabilities used for the simulation. If |
lambda |
The posterior probability threshold. |
tau_scale |
Standard deviation of the half normal prior distribution for the variance of the thetas. |
iter |
The number of iterations in the simulation. Is ignored if
|
n_mcmc |
Number of MCMC samples. |
data |
An object of class |
... |
Further arguments. |
A matrix of results with iter rows. A 0 means, that the
null hypothesis that the response probability exceeds p0 was not
rejected, a 1 means, that the null hypothesis was rejected.
design <- setup_bhm(k = 3, p0 = 0.2, p_target = 0.5) # Equal sample sizes get_results(design, n = 20, p1 = c(0.2, 0.5, 0.5), lambda = 0.95, tau_scale = 1, iter = 100) # Unequal sample sizes get_results(design, n = c(15, 20, 25), p1 = c(0.2, 0.5, 0.5), lambda = 0.95, tau_scale = 1, iter = 100)design <- setup_bhm(k = 3, p0 = 0.2, p_target = 0.5) # Equal sample sizes get_results(design, n = 20, p1 = c(0.2, 0.5, 0.5), lambda = 0.95, tau_scale = 1, iter = 100) # Unequal sample sizes get_results(design, n = c(15, 20, 25), p1 = c(0.2, 0.5, 0.5), lambda = 0.95, tau_scale = 1, iter = 100)
Get Results for Simulation of a Basket Trial with a Calibrated Power Prior Design
## S3 method for class 'cpp' get_results( design, n, p1 = NULL, lambda, tune_a, tune_b, iter = 1000, data = NULL, ... )## S3 method for class 'cpp' get_results( design, n, p1 = NULL, lambda, tune_a, tune_b, iter = 1000, data = NULL, ... )
design |
An object of class |
n |
The sample sizes of the baskets. A vector must be used for varying sample sizes. |
p1 |
Probabilities used for the simulation. If |
lambda |
The posterior probability threshold. |
tune_a |
First tuning parameter that determines the amount of borrowing based on pairwise similarity between baskets. |
tune_b |
Second tuning parameter that determines the amount of borrowing based on pairwise similarity between baskets. |
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 |
... |
Further arguments. |
A matrix of results with iter rows. A 0 means, that the
null hypothesis that the response probability exceeds p0 was not
rejected, a 1 means, that the null hypothesis was rejected.
design <- setup_cpp(k = 3, p0 = 0.2) # Equal sample sizes get_results(design = design, n = 20, p1 = c(0.2, 0.5, 0.5), lambda = 0.95, tune_a = 1, tune_b = 1, iter = 100) # Unequal sample sizes get_results(design = design, n = c(15, 20, 25), p1 = c(0.2, 0.5, 0.5), lambda = 0.95, tune_a = 1, tune_b = 1, iter = 100)design <- setup_cpp(k = 3, p0 = 0.2) # Equal sample sizes get_results(design = design, n = 20, p1 = c(0.2, 0.5, 0.5), lambda = 0.95, tune_a = 1, tune_b = 1, iter = 100) # Unequal sample sizes get_results(design = design, n = c(15, 20, 25), p1 = c(0.2, 0.5, 0.5), lambda = 0.95, tune_a = 1, tune_b = 1, iter = 100)
Get Results for Simulation of a Basket Trial with a Global Calibrated Power Prior Design
## S3 method for class 'cppglobal' get_results( design, n, p1 = NULL, lambda, tune_a, tune_b, epsilon, iter = 1000, data = NULL, ... )## S3 method for class 'cppglobal' get_results( design, n, p1 = NULL, lambda, tune_a, tune_b, epsilon, iter = 1000, data = NULL, ... )
design |
An object of class |
n |
The sample sizes of the baskets. A vector must be used for varying sample sizes. |
p1 |
Probabilities used for the simulation. If |
lambda |
The posterior probability threshold. |
tune_a |
First tuning parameter that determines the amount of borrowing based on pairwise similarity between baskets. |
tune_b |
Second tuning parameter that determines the amount of borrowing based on pairwise similarity between baskets. |
epsilon |
Tuning parameter that determines the amount of borrowing based on overall heterogeneity. |
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 |
... |
Further arguments. |
A matrix of results with iter rows. A 0 means, that the
null hypothesis that the response probability exceeds p0 was not
rejected, a 1 means, that the null hypothesis was rejected.
design <- setup_cppglobal(k = 3, p0 = 0.2) get_results(design = design, n = 20, p1 = c(0.2, 0.5, 0.5), lambda = 0.95, tune_a = 1, tune_b = 1, epsilon = 2, iter = 100)design <- setup_cppglobal(k = 3, p0 = 0.2) get_results(design = design, n = 20, p1 = c(0.2, 0.5, 0.5), lambda = 0.95, tune_a = 1, tune_b = 1, epsilon = 2, iter = 100)
Get Results for Simulation of a Basket Trial with a Limited Calibrated Power Prior Design
## S3 method for class 'cpplim' get_results( design, n, p1 = NULL, lambda, tune_a, tune_b, iter = 1000, data = NULL, ... )## S3 method for class 'cpplim' get_results( design, n, p1 = NULL, lambda, tune_a, tune_b, iter = 1000, data = NULL, ... )
design |
An object of class |
n |
The sample sizes of the baskets. A vector must be used for varying sample sizes. |
p1 |
Probabilities used for the simulation. If |
lambda |
The posterior probability threshold. |
tune_a |
First tuning parameter that determines the amount of borrowing based on pairwise similarity between baskets. |
tune_b |
Second tuning parameter that determines the amount of borrowing based on pairwise similarity between baskets. |
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 |
... |
Further arguments. |
A matrix of results with iter rows. A 0 means, that the
null hypothesis that the response probability exceeds p0 was not
rejected, a 1 means, that the null hypothesis was rejected.
design <- setup_cpplim(k = 3, p0 = 0.2) # Equal sample sizes get_results(design = design, n = 20, p1 = c(0.2, 0.5, 0.5), lambda = 0.95, tune_a = 1, tune_b = 1, iter = 100) # Unequal sample sizes get_results(design = design, n = c(15, 20, 25), p1 = c(0.2, 0.5, 0.5), lambda = 0.95, tune_a = 1, tune_b = 1, iter = 100)design <- setup_cpplim(k = 3, p0 = 0.2) # Equal sample sizes get_results(design = design, n = 20, p1 = c(0.2, 0.5, 0.5), lambda = 0.95, tune_a = 1, tune_b = 1, iter = 100) # Unequal sample sizes get_results(design = design, n = c(15, 20, 25), p1 = c(0.2, 0.5, 0.5), lambda = 0.95, tune_a = 1, tune_b = 1, iter = 100)
Get Results for Simulation of a Basket Trial with the EXNEX Design
## S3 method for class 'exnex' get_results( design, n, p1 = NULL, lambda, tau_scale, w_j, iter = 1000, n_mcmc = 10000, data = NULL, ... )## S3 method for class 'exnex' get_results( design, n, p1 = NULL, lambda, tau_scale, w_j, iter = 1000, n_mcmc = 10000, data = NULL, ... )
design |
An object of class |
n |
The sample sizes of the baskets. A vector must be used for varying sample sizes. |
p1 |
Probabilities used for the simulation. If |
lambda |
The posterior probability threshold. |
tau_scale |
Standard deviation of the half normal prior exchangeability distribution for the variance of the thetas. |
w_j |
Fixed prior weight for the exchangeability part of the model. |
iter |
The number of iterations in the simulation. Is ignored if
|
n_mcmc |
Number of MCMC samples. |
data |
An object of class |
... |
Further arguments. |
A matrix of results with iter rows. A 0 means, that the
null hypothesis that the response probability exceeds p0 was not
rejected, a 1 means, that the null hypothesis was rejected.
design <- setup_exnex(k = 3, p0 = 0.2) # Equal sample sizes get_results(design, n = 20, p1 = c(0.2, 0.5, 0.5), lambda = 0.95, tau_scale = 1, w_j = 0.5, iter = 100) # Unequal sample sizes get_results(design, n = c(15, 20, 25), p1 = c(0.2, 0.5, 0.5), lambda = 0.95, tau_scale = 1, w_j = 0.5, iter = 100)design <- setup_exnex(k = 3, p0 = 0.2) # Equal sample sizes get_results(design, n = 20, p1 = c(0.2, 0.5, 0.5), lambda = 0.95, tau_scale = 1, w_j = 0.5, iter = 100) # Unequal sample sizes get_results(design, n = c(15, 20, 25), p1 = c(0.2, 0.5, 0.5), lambda = 0.95, tau_scale = 1, w_j = 0.5, iter = 100)
Get Results for Simulation of a Basket Trial with Fujikawa's Design
## S3 method for class 'fujikawa' get_results( design, n, p1 = NULL, lambda, epsilon, tau, logbase = 2, iter = 1000, data = NULL, ... )## S3 method for class 'fujikawa' get_results( design, n, p1 = NULL, lambda, epsilon, tau, logbase = 2, iter = 1000, data = NULL, ... )
design |
An object of class |
n |
The sample sizes of the baskets. A vector must be used for varying sample sizes. |
p1 |
Probabilities used for the simulation. If |
lambda |
The posterior probability threshold. |
epsilon |
Tuning parameter that determines the amount of borrowing.
See |
tau |
Tuning parameter that determines how similar the baskets
have to be that information is shared. See |
logbase |
Tuning parameter. The base of the logarithm that is used to calculate the Jensen-Shannon divergence. |
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 |
... |
Further arguments. |
A matrix of results with iter rows. A 0 means, that the
null hypothesis that the response probability exceeds p0 was not
rejected, a 1 means, that the null hypothesis was rejected.
design <- setup_fujikawa(k = 3, p0 = 0.2) # Equal sample sizes get_results(design = design, n = 20, p1 = c(0.2, 0.5, 0.5), lambda = 0.95, epsilon = 2, tau = 0, iter = 100) # Unequal sample sizes get_results(design = design, n = c(15, 20, 25), p1 = c(0.2, 0.5, 0.5), lambda = 0.95, epsilon = 2, tau = 0, iter = 100)design <- setup_fujikawa(k = 3, p0 = 0.2) # Equal sample sizes get_results(design = design, n = 20, p1 = c(0.2, 0.5, 0.5), lambda = 0.95, epsilon = 2, tau = 0, iter = 100) # Unequal sample sizes get_results(design = design, n = c(15, 20, 25), p1 = c(0.2, 0.5, 0.5), lambda = 0.95, epsilon = 2, tau = 0, iter = 100)
Get Results for Simulation of a Basket Trial with the Power Prior Design Based on Global JSD Weights
## S3 method for class 'jsdglobal' get_results( design, n, p1 = NULL, lambda, eps_pair, tau = 0, eps_all, logbase = 2, iter = 1000, data = NULL, ... )## S3 method for class 'jsdglobal' get_results( design, n, p1 = NULL, lambda, eps_pair, tau = 0, eps_all, logbase = 2, iter = 1000, data = NULL, ... )
design |
An object of class |
n |
The sample sizes of the baskets. A vector must be used for varying sample sizes. |
p1 |
Probabilities used for the simulation. If |
lambda |
The posterior probability threshold. |
eps_pair |
Tuning parameter that determines the amount of borrowing based on pairwise similarity. |
tau |
Tuning parameter that determines how similar the baskets have to be that information is shared. |
eps_all |
Tuning parameter that determines the amount of borrowing based on overall heterogeneity. |
logbase |
Tuning parameter. The base of the logarithm that is used to calculate the Jensen-Shannon divergence. |
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 |
... |
Further arguments. |
A matrix of results with iter rows. A 0 means, that the
null hypothesis that the response probability exceeds p0 was not
rejected, a 1 means, that the null hypothesis was rejected.
design <- setup_jsdglobal(k = 3, p0 = 0.2) get_results(design = design, n = 20, p1 = c(0.2, 0.5, 0.5), lambda = 0.95, eps_pair = 2, eps_all = 2, iter = 100)design <- setup_jsdglobal(k = 3, p0 = 0.2) get_results(design = design, n = 20, p1 = c(0.2, 0.5, 0.5), lambda = 0.95, eps_pair = 2, eps_all = 2, iter = 100)
Get Results for Simulation of a Basket Trial with the MML Design
## S3 method for class 'mml' get_results(design, n, p1 = NULL, lambda, iter = 1000, data = NULL, ...)## S3 method for class 'mml' get_results(design, n, p1 = NULL, lambda, iter = 1000, data = NULL, ...)
design |
An object of class |
n |
The sample sizes of the baskets. A vector must be used for varying sample sizes. |
p1 |
Probabilities used for the simulation. If |
lambda |
The posterior probability threshold. |
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 |
... |
Further arguments. |
A matrix of results with iter rows. A 0 means, that the
null hypothesis that the response probability exceeds p0 was not
rejected, a 1 means, that the null hypothesis was rejected.
design <- setup_mml(k = 3, p0 = 0.2) get_results(design, n = 20, p1 = c(0.2, 0.5, 0.5), lambda = 0.95, iter = 100)design <- setup_mml(k = 3, p0 = 0.2) get_results(design, n = 20, p1 = c(0.2, 0.5, 0.5), lambda = 0.95, iter = 100)
Get Results for Simulation of a Basket Trial with the Global MML Design
## S3 method for class 'mmlglobal' get_results(design, n, p1 = NULL, lambda, iter = 1000, data = NULL, ...)## S3 method for class 'mmlglobal' get_results(design, n, p1 = NULL, lambda, iter = 1000, data = NULL, ...)
design |
An object of class |
n |
The sample sizes of the baskets. A vector must be used for varying sample sizes. |
p1 |
Probabilities used for the simulation. If |
lambda |
The posterior probability threshold. |
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 |
... |
Further arguments. |
A matrix of results with iter rows. A 0 means, that the
null hypothesis that the response probability exceeds p0 was not
rejected, a 1 means, that the null hypothesis was rejected.
design <- setup_mmlglobal(k = 3, p0 = 0.2) get_results(design, n = 20, p1 = c(0.2, 0.5, 0.5), lambda = 0.95, iter = 100)design <- setup_mmlglobal(k = 3, p0 = 0.2) get_results(design, n = 20, p1 = c(0.2, 0.5, 0.5), lambda = 0.95, iter = 100)
Creates a default scenario matrix.
get_scenarios(design, p1)get_scenarios(design, p1)
design |
An object created with one of the |
p1 |
Probability under the alternative hypothesis. |
get_scenarios creates a default scenario matrix
that can be used for opt_design. The function creates
k + 1 scenarios, from a global null to a global alternative scenario.
A matrix with k rows and k + 1 columns.
design <- setup_fujikawa(k = 3, p0 = 0.2) get_scenarios(design = design, p1 = 0.5)design <- setup_fujikawa(k = 3, p0 = 0.2) get_scenarios(design = design, p1 = 0.5)
Optimize a Basket Trial Design
opt_design( design, n, alpha, design_params = list(), scenarios, prec_digits, iter = 1000, data = NULL, ... )opt_design( design, n, alpha, design_params = list(), scenarios, prec_digits, iter = 1000, data = NULL, ... )
design |
An object created with one of the |
n |
The sample sizes of the baskets. A vector must be used for varying sample sizes. |
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 list of data matrices generated with |
... |
Further arguments. |
A matrix with the expected number of correct decisions.
design <- setup_fujikawa(k = 3, p0 = 0.2) scenarios <- get_scenarios(design, p1 = 0.5) ## Equal sample sizes # 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) ## Unequal sample sizes # Without simulated data opt_design(design, n = c(15, 20, 25), 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 = c(15, 20, 25), p = x, iter = 1000)) opt_design(design, n = c(15, 20, 25), alpha = 0.05, design_params = list(epsilon = c(1, 2), tau = c(0, 0.5)), scenarios = scenarios, prec_digits = 3, data = data_list)design <- setup_fujikawa(k = 3, p0 = 0.2) scenarios <- get_scenarios(design, p1 = 0.5) ## Equal sample sizes # 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) ## Unequal sample sizes # Without simulated data opt_design(design, n = c(15, 20, 25), 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 = c(15, 20, 25), p = x, iter = 1000)) opt_design(design, n = c(15, 20, 25), alpha = 0.05, design_params = list(epsilon = c(1, 2), tau = c(0, 0.5)), scenarios = scenarios, prec_digits = 3, data = data_list)
Set Up Adaptive Power Prior Design Object
setup_app(k, p0, shape1 = 1, shape2 = 1)setup_app(k, p0, shape1 = 1, shape2 = 1)
k |
The number of baskets. |
p0 |
A common probability under the null hypothesis. |
shape1 |
First common shape parameter of the beta prior. |
shape2 |
Second common shape parameter of the beta prior. |
The class app implements the adaptive power prior design for
sequential clinical trials proposed by Ollier et al. (2020).
An S3 object of class app
Ollier, A., Morita, S., Ursino, M., & Zohar, S. (2020). An adaptive power prior for sequential clinical trials - Application to bridging studies. Statistical methods in medical research, 29(8), 2282–2294.
design_app <- setup_app(k = 3, p0 = 0.2)design_app <- setup_app(k = 3, p0 = 0.2)
Set Up BHM Design Object
setup_bhm(k, p0, p_target, mu_mean = NULL, mu_sd = 100)setup_bhm(k, p0, p_target, mu_mean = NULL, mu_sd = 100)
k |
The number of baskets. |
p0 |
A common probability under the null hypothesis. |
p_target |
The response rate of interest. See details. |
mu_mean |
Mean of the normal prior distribution for the mean of the thetas. See details. |
mu_sd |
Standard deviation of the normal prior distribution for the mean of the thetas. |
The class bhm implements the Bayesian Hierarchical Model
proposed by Berry et al. (2013). Methods for this class are
mostly wrappers for functions from the package bhmbasket.
In the BHM the thetas of all baskets are modeled, where theta_i =
logit(p_i) - logit(p_target). These thetas are assumed to come from
a normal distribution with mean mu_mean and standard deviation mu_sd.
If mu_mean = NULL then mu_mean is determined as logit(p0) -
logit(p_target), hence the mean of the normal distribution corresponds
to the null hypothesis.
An S3 object of class bhm
Berry, S. M., Broglio, K. R., Groshen, S., & Berry, D. A. (2013). Bayesian hierarchical modeling of patient subpopulations: efficient designs of phase II oncology clinical trials. Clinical Trials, 10(5), 720-734.
design_bhm <- setup_bhm(k = 3, p0 = 0.2, p_target = 0.5)design_bhm <- setup_bhm(k = 3, p0 = 0.2, p_target = 0.5)
Set Up Frequentist Binomial Design Object
setup_binomial(k, p0, pool = FALSE)setup_binomial(k, p0, pool = FALSE)
k |
The number of baskets. |
p0 |
A common probability under the null hypothesis. |
pool |
A logical, should data from all baskets be pooled? Default is
|
The class binomial implements a basket trial
design, in which each null hypothesis is tested using the
frequentist binomial test without multiplicity correction. All baskets are
either tested separately (the default) or pooled (not implemented yet).
An S3 object of class binomial
design_binomial <- setup_binomial(k = 3, p0 = 0.2)design_binomial <- setup_binomial(k = 3, p0 = 0.2)
Set Up Calibrated Power Prior Design Object
setup_cpp(k, p0, shape1 = 1, shape2 = 1)setup_cpp(k, p0, shape1 = 1, shape2 = 1)
k |
The number of baskets. |
p0 |
A common probability under the null hypothesis. |
shape1 |
First common shape parameter of the beta prior. |
shape2 |
Second common shape parameter of the beta prior. |
The class cpp implements a version of the power prior design,
in which the amount of information that is shared between baskets is
determined by the Kolmogorov-Smirnov test statistic between baskets (which
is equivalent to the absolut difference in response rates).
An S3 object of class cpp
Baumann, L., Sauer, L. D., & Kieser, M. (2025). A Basket Trial Design Based on Power Priors. Statistics in Biopharmaceutical Research, 17(3), 446–456. https://doi.org/10.1080/19466315.2024.2402275
design_cpp <- setup_cpp(k = 3, p0 = 0.2)design_cpp <- setup_cpp(k = 3, p0 = 0.2)
Set Up Global Calibrated Power Prior Design Object
setup_cppglobal(k, p0, shape1 = 1, shape2 = 1)setup_cppglobal(k, p0, shape1 = 1, shape2 = 1)
k |
The number of baskets. |
p0 |
A common probability under the null hypothesis. |
shape1 |
First common shape parameter of the beta prior. |
shape2 |
Second common shape parameter of the beta prior. |
The class cppglobal implements a version of the power prior
design, in which the amount of information that is shared between baskets is
determined by the Kolmogorov-Smirnov test statistic between basekts and
a function based on response rate differences that quantifies the
overall heterogeneity.
An S3 object of class cppglobal
Baumann, L., Sauer, L. D., & Kieser, M. (2025). A Basket Trial Design Based on Power Priors. Statistics in Biopharmaceutical Research, 17(3), 446–456. https://doi.org/10.1080/19466315.2024.2402275
design_cppglobal <- setup_cppglobal(k = 3, p0 = 0.2)design_cppglobal <- setup_cppglobal(k = 3, p0 = 0.2)
Set Up Limited Calibrated Power Prior Design Object
setup_cpplim(k, p0, shape1 = 1, shape2 = 1)setup_cpplim(k, p0, shape1 = 1, shape2 = 1)
k |
The number of baskets. |
p0 |
A common probability under the null hypothesis. |
shape1 |
First common shape parameter of the beta prior. |
shape2 |
Second common shape parameter of the beta prior. |
The class cpplim implements a combined version of the adaptive power
prior (app) and the calibrated power prior (cpp), where the
parameter limiting the amount of information to be borrowed in the adaptive
power prior design is included in the calibrated power prior design.
An S3 object of class cpplim
Ollier, A., Morita, S., Ursino, M., & Zohar, S. (2020). An adaptive power prior for sequential clinical trials - Application to bridging studies. Statistical methods in medical research, 29(8), 2282–2294.
Baumann, L., Sauer, L. D., & Kieser, M. (2025). A Basket Trial Design Based on Power Priors. Statistics in Biopharmaceutical Research, 17(3), 446–456. https://doi.org/10.1080/19466315.2024.2402275
design_cpplim <- setup_cpplim(k = 3, p0 = 0.2)design_cpplim <- setup_cpplim(k = 3, p0 = 0.2)
Set Up EXNEX Design Object
setup_exnex( k, p0, basket_mean = NULL, basket_sd = 100, mu_mean = NULL, mu_sd = 100 )setup_exnex( k, p0, basket_mean = NULL, basket_sd = 100, mu_mean = NULL, mu_sd = 100 )
k |
The number of baskets. |
p0 |
A common probability under the null hypothesis. |
basket_mean |
Mean of the normal prior distribution of the individual thetas (NEX part). See details. |
basket_sd |
Standard deviation of the normal prior distribution of the individual thetas (NEX part). |
mu_mean |
Mean of the normal prior exchangeability distribution for the mean of the thetas (EX part). See details. |
mu_sd |
Standard deviation of the normal prior exchangeability distribution for the mean of the thetas (EX part). |
The class exnex implements the EXNEX model proposed by
Neuenschwander et al. (2016). Methods for this class are mostly wrappers
for functions from the package bhmbasket.
In the EXNEX model the thetas of all baskets are modeled as a mixture
of individual models and a Bayesian Hierarchical Model with a fixed
mixture weight w. If mu_mean and basket_mean are NULL
then they are set to logit(p0).
Note that Neuenschwander et al. (2016) use different prior means and
standard deviations. The default values here are used for better comparison
with the BHM model (see setup_bhm).
An S3 object of class exnex
Neuenschwander, B., Wandel, S., Roychoudhury, S., & Bailey, S. (2016). Robust exchangeability designs for early phase clinical trials with multiple strata. Pharmaceutical statistics, 15(2), 123-134.
design_exnex <- setup_exnex(k = 3, p0 = 0.2)design_exnex <- setup_exnex(k = 3, p0 = 0.2)
Set Up Fujikawa Design Object
setup_fujikawa(k, p0, shape1 = 1, shape2 = 1)setup_fujikawa(k, p0, shape1 = 1, shape2 = 1)
k |
The number of baskets. |
p0 |
A common probability under the null hypothesis. |
shape1 |
First common shape parameter of the beta prior. |
shape2 |
Second common shape parameter of the beta prior. |
The class fujikawa implements a design by Fujikawa et al.
(2020) in which information is shared based on the pairwise similarity
between baskets which is quantified using the Jensen-Shannon divergence
between the individual posterior distributions between baskets.
An S3 object of class fujikawa
Fujikawa, K., Teramukai, S., Yokota, I., & Daimon, T. (2020). A Bayesian basket trial design that borrows information across strata based on the similarity between the posterior distributions of the response probability. Biometrical Journal, 62(2), 330-338.
design_fujikawa <- setup_fujikawa(k = 3, p0 = 0.2)design_fujikawa <- setup_fujikawa(k = 3, p0 = 0.2)
Set Up Global JSD Design Object
setup_jsdglobal(k, p0, shape1 = 1, shape2 = 1)setup_jsdglobal(k, p0, shape1 = 1, shape2 = 1)
k |
The number of baskets. |
p0 |
A common probability under the null hypothesis. |
shape1 |
First common shape parameter of the beta prior. |
shape2 |
Second common shape parameter of the beta prior. |
The class jsdglobal implements a version of the power prior
design, in which information is shared based on pairwise similarity
and overall heterogeneity between baskets. Both pairwise similarity and
overall heterogeneity are assessed using the Jensen-Shannon divergence.
An S3 object of class jsdglobal
Baumann, L., Sauer, L. D., & Kieser, M. (2025). A Basket Trial Design Based on Power Priors. Statistics in Biopharmaceutical Research, 17(3), 446–456. https://doi.org/10.1080/19466315.2024.2402275
design_jsdglobal <- setup_jsdglobal(k = 3, p0 = 0.2)design_jsdglobal <- setup_jsdglobal(k = 3, p0 = 0.2)
Creates an object of class mml.
setup_mml(k, p0, shape1 = 1, shape2 = 1)setup_mml(k, p0, shape1 = 1, shape2 = 1)
k |
The number of baskets. |
p0 |
A common probability under the null hypothesis. |
shape1 |
First common shape parameter of the beta prior. |
shape2 |
Second common shape parameter of the beta prior. |
The class mml implements a modified version of the
empirical Bayes method by Gravestock & Held (2017) which was proposed for
borrowing strength from an external study. In their approach, the sharing
weight is found as the maximum of the marginal likelihood of the
weight, given the external data set. This leads, however, to
non-symmetric weights when applied to sharing in basket trials, i.e.
Basket i would not share the information from Basket j as the other way
round. Therefore, a symmetrised version is used, where the mean of the
two weights resulting from sharing in both directions is used.
An S3 object of class mml
Gravestock, I., & Held, L. (2017). Adaptive power priors with empirical Bayes for clinical trials. Pharmaceutical statistics, 16(5), 349-360.
design_mml <- setup_mml(k = 3, p0 = 0.2)design_mml <- setup_mml(k = 3, p0 = 0.2)
Creates an object of class mmlglobal.
setup_mmlglobal(k, p0, shape1 = 1, shape2 = 1)setup_mmlglobal(k, p0, shape1 = 1, shape2 = 1)
k |
The number of baskets. |
p0 |
A common probability under the null hypothesis. |
shape1 |
First common shape parameter of the beta prior. |
shape2 |
Second common shape parameter of the beta prior. |
The class mmlglobal implements an empirical Bayes method
by Gravestock & Held (2019) which was proposed for borrowing strength
from multiple external studies.
An S3 object of class mmlglobal
Gravestock, I., & Held, L. (2019). Power priors based on multiple historical studies for binary outcomes. Biometrical Journal, 61(5), 1201-1218.
Baumann, L., Sauer, L. D., & Kieser, M. (2025). A Basket Trial Design Based on Power Priors. Statistics in Biopharmaceutical Research, 17(3), 446–456. https://doi.org/10.1080/19466315.2024.2402275
design_mmlglobal <- setup_mmlglobal(k = 3, p0 = 0.2)design_mmlglobal <- setup_mmlglobal(k = 3, p0 = 0.2)
Calculate the Type 1 Error Rate for a Basket Trial Design
toer( design, n, p1 = NULL, lambda, design_params = list(), iter = 1000, data = NULL, ... )toer( design, n, p1 = NULL, lambda, design_params = list(), iter = 1000, data = NULL, ... )
design |
An object created with one of the |
n |
The sample sizes of the baskets. A vector must be used for varying sample sizes. |
p1 |
Probabilities under the alternative hypothesis. If |
lambda |
The posterior probability threshold. |
design_params |
A list of params that is specific to the class of
|
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 |
... |
Further arguments. |
A numeric value.
# Example for a basket trial with Fujikawa's Design design <- setup_fujikawa(k = 3, p0 = 0.2) # Equal sample sizes toer(design = design, n = 20, p1 = c(0.2, 0.5, 0.5), lambda = 0.95, design_params = list(epsilon = 2, tau = 0), iter = 1000) # Unequal sample sizes toer(design = design, n = c(15, 20, 25), p1 = c(0.2, 0.5, 0.5), lambda = 0.95, design_params = list(epsilon = 2, tau = 0), iter = 1000)# Example for a basket trial with Fujikawa's Design design <- setup_fujikawa(k = 3, p0 = 0.2) # Equal sample sizes toer(design = design, n = 20, p1 = c(0.2, 0.5, 0.5), lambda = 0.95, design_params = list(epsilon = 2, tau = 0), iter = 1000) # Unequal sample sizes toer(design = design, n = c(15, 20, 25), p1 = c(0.2, 0.5, 0.5), lambda = 0.95, design_params = list(epsilon = 2, tau = 0), iter = 1000)