Title: | Analytical Calculation of Basket Trial Operating Characteristics |
---|---|
Description: | Analytically calculates the operating characteristics of single-stage and two-stage basket trials with equal sample sizes using the power prior design by Baumann et al. (2024) <doi:10.48550/arXiv.2309.06988> and the design by Fujikawa et al. (2020) <doi:10.1002/bimj.201800404>. |
Authors: | Lukas Baumann [aut, cre] |
Maintainer: | Lukas Baumann <[email protected]> |
License: | GPL (>= 3) |
Version: | 1.0.2 |
Built: | 2024-11-13 05:30:03 UTC |
Source: | https://github.com/lbau7/baskexact |
Finds the value for lambda
such that the family wise error
rate is protected at level alpha
.
adjust_lambda(design, ...) ## S4 method for signature 'OneStageBasket' adjust_lambda( design, alpha = 0.025, p1 = NULL, n, weight_fun, weight_params = list(), globalweight_fun = NULL, globalweight_params = list(), prec_digits, ... ) ## S4 method for signature 'TwoStageBasket' adjust_lambda( design, alpha = 0.025, p1 = NULL, n, n1, interim_fun, interim_params = list(), weight_fun, weight_params = list(), globalweight_fun = NULL, globalweight_params = list(), prec_digits, ... )
adjust_lambda(design, ...) ## S4 method for signature 'OneStageBasket' adjust_lambda( design, alpha = 0.025, p1 = NULL, n, weight_fun, weight_params = list(), globalweight_fun = NULL, globalweight_params = list(), prec_digits, ... ) ## S4 method for signature 'TwoStageBasket' adjust_lambda( design, alpha = 0.025, p1 = NULL, n, n1, interim_fun, interim_params = list(), weight_fun, weight_params = list(), globalweight_fun = NULL, globalweight_params = list(), prec_digits, ... )
design |
An object of class |
... |
Further arguments. |
alpha |
The one-sided signifance level. |
p1 |
Probabilities under the alternative hypothesis. If
|
n |
The sample size per basket. |
weight_fun |
Which function should be used to calculate the pairwise weights. |
weight_params |
A list of tuning parameters specific to
|
globalweight_fun |
Which function should be used to calculate the global weights. |
globalweight_params |
A list of tuning parameters specific to
|
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
|
adjust_alpha
finds the greatest value with
prec_digits
for lambda
which controls the family wise error
rate at level alpha
(one-sided). A combination of the uniroot
function followed by a grid search is used to finde the correct value
for lambda
.
The greatest value with prec_digits
decimal places for
lambda
which controls the family wise error rate at level
alpha
(one-sided) and the exact family wise error rate for this
value of lambda
.
adjust_lambda(OneStageBasket)
: Adjust lambda for a single-stage design.
adjust_lambda(TwoStageBasket)
: Adjust lambda for a two-stage design.
design <- setupOneStageBasket(k = 3, shape1 = 1, shape2 = 1, p0 = 0.2) adjust_lambda(design = design, alpha = 0.025, n = 15, weight_fun = weights_fujikawa, prec_digits = 4)
design <- setupOneStageBasket(k = 3, shape1 = 1, shape2 = 1, p0 = 0.2) adjust_lambda(design = design, alpha = 0.025, n = 15, weight_fun = weights_fujikawa, prec_digits = 4)
basket_test
evaluates the results of a basket trial and calculates
the posterior distributions with and without borrowing.
basket_test(design, ...) ## S4 method for signature 'OneStageBasket' basket_test( design, n, r, lambda, weight_fun, weight_params = list(), globalweight_fun = NULL, globalweight_params = list(), details = TRUE, ... )
basket_test(design, ...) ## S4 method for signature 'OneStageBasket' basket_test( design, n, r, lambda, weight_fun, weight_params = list(), globalweight_fun = NULL, globalweight_params = list(), details = TRUE, ... )
design |
An object of class |
... |
Further arguments. |
n |
The sample size per basket. |
r |
The vector of observed responses. |
lambda |
The posterior probability threshold. See details for more information. |
weight_fun |
Which function should be used to calculate the pairwise weights. |
weight_params |
A list of tuning parameters specific to
|
globalweight_fun |
Which function should be used to calculate the global weights. |
globalweight_params |
A list of tuning parameters specific to
|
details |
Whether a detailed list of results or only the vector of posterior probabilities is returned. |
If details = TRUE
: A list, including matrices of the weights
that are used for borrowing, posterior distribution parameters for all
baskets without and with borrowing, as well as the posterior probabilities
for all baskets without and with borrowing. If details = FALSE
:
The posterior probabilities for all baskets with borrowing.
basket_test(OneStageBasket)
: Testing for a single-stage basket design.
design <- setupOneStageBasket(k = 3, shape1 = 1, shape2 = 1, p0 = 0.2) basket_test(design = design, n = 24, r = c(5, 9, 10), lambda = 0.99, weight_fun = weights_fujikawa)
design <- setupOneStageBasket(k = 3, shape1 = 1, shape2 = 1, p0 = 0.2) basket_test(design = design, n = 24, r = c(5, 9, 10), lambda = 0.99, weight_fun = weights_fujikawa)
Checks whether the between-trial monotonicity condition holds.
check_mon_between(design, ...) ## S4 method for signature 'OneStageBasket' check_mon_between( design, n, lambda, weight_fun, weight_params = list(), details = TRUE, globalweight_fun = NULL, globalweight_params = list(), ... )
check_mon_between(design, ...) ## S4 method for signature 'OneStageBasket' check_mon_between( design, n, lambda, weight_fun, weight_params = list(), details = TRUE, globalweight_fun = NULL, globalweight_params = list(), ... )
design |
An object of class |
... |
Further arguments. |
n |
The sample size per basket. |
lambda |
The posterior probability threshold. See details for more information. |
weight_fun |
Which function should be used to calculate the pairwise weights. |
weight_params |
A list of tuning parameters specific to
|
details |
Whether the cases where the monotonicity condition is violated should be returned, in case there are any. |
globalweight_fun |
Which function should be used to calculate the global weights. |
globalweight_params |
A list of tuning parameters specific to
|
check_mon_between
checks whether the between-trial
monotonicity condition holds. For a single-stage design with equal prior
distributions and equal sample sizes for each basket this condition states
that there are no cases where at least one null hypothesis is rejected when
when there is a case with an equal or higher number of responses in each
basket for which no null hypothesis is rejected.
If prune = TRUE
then the baskets with an observed number of baskets
smaller than the pooled critical value are not borrowed from. The
pooled critical value is the smallest integer c for which all null
hypotheses can be rejected if the number of responses is exactly c for
all baskets.
The function is vectorized, such that vectors can be specified in
weight_params
and globalweight_params
.
If details = FALSE
then only a logical value is returned.
If details = TRUE
then if there are any cases where the
between-trial monotonicity condition is violated, a list of theses cases
and their results are returned.
check_mon_between(OneStageBasket)
: Between-trial monotonicity condition for a
single-stage design.
Baumann, L., Krisam, J., & Kieser, M. (2022). Monotonicity conditions for avoiding counterintuitive decisions in basket trials. Biometrical Journal, 64(5), 934-947.
design <- setupOneStageBasket(k = 4, shape1 = 1, shape2 = 1, p0 = 0.2) # Without vectorization, with details check_mon_between(design = design, n = 24, lambda = 0.99, weight_fun = weights_fujikawa, weight_params = list(epsilon = 3, tau = 0), details = TRUE) # Vectorized check_mon_between(design = design, n = 24, lambda = 0.99, weight_fun = weights_fujikawa, weight_params = list(epsilon = c(0.5, 1), tau = c(0, 0.2, 0.3)), globalweight_fun = globalweights_fix, globalweight_params = list(w = c(0.5, 0.7)))
design <- setupOneStageBasket(k = 4, shape1 = 1, shape2 = 1, p0 = 0.2) # Without vectorization, with details check_mon_between(design = design, n = 24, lambda = 0.99, weight_fun = weights_fujikawa, weight_params = list(epsilon = 3, tau = 0), details = TRUE) # Vectorized check_mon_between(design = design, n = 24, lambda = 0.99, weight_fun = weights_fujikawa, weight_params = list(epsilon = c(0.5, 1), tau = c(0, 0.2, 0.3)), globalweight_fun = globalweights_fix, globalweight_params = list(w = c(0.5, 0.7)))
Checks whether the within-trial monotonicity condition holds.
check_mon_within(design, ...) ## S4 method for signature 'OneStageBasket' check_mon_within( design, n, lambda, weight_fun, weight_params = list(), globalweight_fun = NULL, globalweight_params = list(), details = TRUE, ... )
check_mon_within(design, ...) ## S4 method for signature 'OneStageBasket' check_mon_within( design, n, lambda, weight_fun, weight_params = list(), globalweight_fun = NULL, globalweight_params = list(), details = TRUE, ... )
design |
An object of class |
... |
Further arguments. |
n |
The sample size per basket. |
lambda |
The posterior probability threshold. See details for more information. |
weight_fun |
Which function should be used to calculate the pairwise weights. |
weight_params |
A list of tuning parameters specific to
|
globalweight_fun |
Which function should be used to calculate the global weights. |
globalweight_params |
A list of tuning parameters specific to
|
details |
Whether the cases where the monotonicity condition is violated should be returned, in case there are any. |
check_mon_within
checks whether the within-trial
monotonicity condition holds. For a single-stage design with equal
prior distributions and equal sample sizes for each basket this condition
states that there are no cases where the null hypothesis of a basket is
rejected when there is at least one other basket with more observed
responses for which the null hypothesis cannot be rejected.
If prune = TRUE
then the baskets with an observed number of baskets
smaller than the pooled critical value are not borrowed from. The
pooled critical value is the smallest integer c for which all null
hypotheses can be rejected if the number of responses is exactly c for
all baskets.
The function is vectorized, such that vectors can be specified in
weight_params
and globalweight_params
.
If details = FALSE
then only a logical value is returned.
If details = TRUE
then if there are any cases where the
within-trial monotonicity condition is violated, a list of these cases and
their results are returned. If at least one tuning parameter is a vector,
then an array that shows for which combination of parameters the
within-trial monotonicity condition holds. In this case, the argument
details
is ignored.
check_mon_within(OneStageBasket)
: Within-trial monotonicity condition for a
single-stage design.
Baumann, L., Krisam, J., & Kieser, M. (2022). Monotonicity conditions for avoiding counterintuitive decisions in basket trials. Biometrical Journal, 64(5), 934-947.
design <- setupOneStageBasket(k = 4, shape1 = 1, shape2 = 1, p0 = 0.2) # Without vectorization, with details design <- setupOneStageBasket(k = 4, shape1 = 1, shape2 = 1, p0 = 0.2) check_mon_within(design = design, n = 24, lambda = 0.99, weight_fun = weights_fujikawa, weight_params = list(epsilon = 0.5, tau = 0), details = TRUE) # Vectorized check_mon_within(design = design, n = 24, lambda = 0.99, weight_fun = weights_fujikawa, weight_params = list(epsilon = c(0.5, 1), tau = c(0, 0.2, 0.3)), globalweight_fun = globalweights_fix, globalweight_params = list(w = c(0.5, 0.7)))
design <- setupOneStageBasket(k = 4, shape1 = 1, shape2 = 1, p0 = 0.2) # Without vectorization, with details design <- setupOneStageBasket(k = 4, shape1 = 1, shape2 = 1, p0 = 0.2) check_mon_within(design = design, n = 24, lambda = 0.99, weight_fun = weights_fujikawa, weight_params = list(epsilon = 0.5, tau = 0), details = TRUE) # Vectorized check_mon_within(design = design, n = 24, lambda = 0.99, weight_fun = weights_fujikawa, weight_params = list(epsilon = c(0.5, 1), tau = c(0, 0.2, 0.3)), globalweight_fun = globalweights_fix, globalweight_params = list(w = c(0.5, 0.7)))
Computes the expected number of correct decisions of a basket trial.
ecd(design, ...) ## S4 method for signature 'OneStageBasket' ecd( design, p1 = NULL, n, lambda, weight_fun, weight_params = list(), globalweight_fun = NULL, globalweight_params = list(), ... ) ## S4 method for signature 'TwoStageBasket' ecd( design, p1 = NULL, n, n1, lambda, interim_fun, interim_params = list(), weight_fun, weight_params = list(), globalweight_fun = NULL, globalweight_params = list(), ... )
ecd(design, ...) ## S4 method for signature 'OneStageBasket' ecd( design, p1 = NULL, n, lambda, weight_fun, weight_params = list(), globalweight_fun = NULL, globalweight_params = list(), ... ) ## S4 method for signature 'TwoStageBasket' ecd( design, p1 = NULL, n, n1, lambda, interim_fun, interim_params = list(), weight_fun, weight_params = list(), globalweight_fun = NULL, globalweight_params = list(), ... )
design |
An object of class |
... |
Further arguments. |
p1 |
Probabilities under the alternative hypothesis. If
|
n |
The sample size per basket. |
lambda |
The posterior probability threshold. See details for more information. |
weight_fun |
Which function should be used to calculate the pairwise weights. |
weight_params |
A list of tuning parameters specific to
|
globalweight_fun |
Which function should be used to calculate the global weights. |
globalweight_params |
A list of tuning parameters specific to
|
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
|
Computes the expected number of correction decisions, i.e. the expected number of actually active baskets that are declared active and actually inactive baskets that are declared inactive.
A numeric value.
ecd(OneStageBasket)
: Expected number of correction decisions for a single-stage
basket design.
ecd(TwoStageBasket)
: Expected number of correction decisions for a two-stage
basket design.
design <- setupOneStageBasket(k = 3, p0 = 0.2) ecd(design = design, p1 = c(0.5, 0.2, 0.2), n = 20, lambda = 0.99, weight_fun = weights_fujikawa)
design <- setupOneStageBasket(k = 3, p0 = 0.2) ecd(design = design, p1 = c(0.5, 0.2, 0.2), n = 20, lambda = 0.99, weight_fun = weights_fujikawa)
Computes the expected sample size of a two-stage basket trial.
ess(design, ...) ## S4 method for signature 'TwoStageBasket' ess( design, p1 = NULL, n, n1, lambda, interim_fun, interim_params = list(), weight_fun, weight_params = list(), globalweight_fun = NULL, globalweight_params = list(), ... )
ess(design, ...) ## S4 method for signature 'TwoStageBasket' ess( design, p1 = NULL, n, n1, lambda, interim_fun, interim_params = list(), weight_fun, weight_params = list(), globalweight_fun = NULL, globalweight_params = list(), ... )
design |
An object of class |
... |
Further arguments. |
p1 |
Probabilities under the alternative hypothesis. If
|
n |
The sample size per basket. |
n1 |
The sample size per basket for the interim analysis in case of a two-stage design. |
lambda |
The posterior probability threshold. See details for more information. |
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
|
weight_fun |
Which function should be used to calculate the pairwise weights. |
weight_params |
A list of tuning parameters specific to
|
globalweight_fun |
Which function should be used to calculate the global weights. |
globalweight_params |
A list of tuning parameters specific to
|
ess(TwoStageBasket)
: Expected sample size for two-stage basket design.
design <- setupTwoStageBasket(k = 3, p0 = 0.2) ess(design, n = 20, n1 = 10, lambda = 0.99, weight_fun = weights_fujikawa, interim_fun = interim_postpred)
design <- setupTwoStageBasket(k = 3, p0 = 0.2) ess(design, n = 20, n1 = 10, lambda = 0.99, weight_fun = weights_fujikawa, interim_fun = interim_postpred)
Computes the posterior mean and the mean squared error of a basket trial design.
estim(design, ...) ## S4 method for signature 'OneStageBasket' estim( design, p1, n, lambda = NULL, weight_fun, weight_params = list(), globalweight_fun = NULL, globalweight_params = list(), ... ) ## S4 method for signature 'TwoStageBasket' estim( design, p1, n, n1, lambda = NULL, interim_fun, interim_params = list(), weight_fun, weight_params = list(), globalweight_fun = NULL, globalweight_params = list(), ... )
estim(design, ...) ## S4 method for signature 'OneStageBasket' estim( design, p1, n, lambda = NULL, weight_fun, weight_params = list(), globalweight_fun = NULL, globalweight_params = list(), ... ) ## S4 method for signature 'TwoStageBasket' estim( design, p1, n, n1, lambda = NULL, interim_fun, interim_params = list(), weight_fun, weight_params = list(), globalweight_fun = NULL, globalweight_params = list(), ... )
design |
An object of class |
... |
Further arguments. |
p1 |
Probabilities under the alternative hypothesis. If
|
n |
The sample size per basket. |
lambda |
The posterior probability threshold. See details for more information. |
weight_fun |
Which function should be used to calculate the pairwise weights. |
weight_params |
A list of tuning parameters specific to
|
globalweight_fun |
Which function should be used to calculate the global weights. |
globalweight_params |
A list of tuning parameters specific to
|
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
|
A list containing means of the posterior distributions and the mean squared errors for all baskets.
estim(OneStageBasket)
: Posterior mean and mean squared error for a single-stage
basket design.
estim(TwoStageBasket)
: Posterior mean and mean squared error for a two-stage
basket design.
design <- setupOneStageBasket(k = 3, p0 = 0.2) estim(design = design, p1 = c(0.2, 0.2, 0.5), n = 15, weight_fun = weights_fujikawa)
design <- setupOneStageBasket(k = 3, p0 = 0.2) estim(design = design, p1 = c(0.2, 0.2, 0.5), n = 15, weight_fun = weights_fujikawa)
Creates a default scenario matrix.
get_scenarios(design, p1)
get_scenarios(design, p1)
design |
An object of class |
p1 |
Probabilitiy 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 <- setupOneStageBasket(k = 3, p0 = 0.2) get_scenarios(design = design, p1 = 0.5)
design <- setupOneStageBasket(k = 3, p0 = 0.2) get_scenarios(design = design, p1 = 0.5)
Global Weights Based on Response Rate Differences
globalweights_diff(n, r, eps_global = 1, w = 1)
globalweights_diff(n, r, eps_global = 1, w = 1)
n |
The sample size per basket. |
r |
Vector of responses. |
eps_global |
A tuning parameter that determines the amount of borrowing. A higher value leads to a smaller weight and therefore less borrowing when the heterogeneity between the results in the baskets increases. |
w |
A fixed probability between 0 and 1. |
globalweights_diff
calculates a weight based on the
heterogeneity of the response rates of all baskets that is multiplied
to the pairwise weights calculated with the function that is passed to
weight_fun
. The weight is 1 when the number of responses is identical
in all baskets and 0 if the response rates are an equidistant sequence
from 0 to 1. If the maximum weight should be smaller than 1, w
can be set to a smaller value.
A numeric value.
globalweights_diff(n = 20, r = c(1, 3, 5), eps_global = 2)
globalweights_diff(n = 20, r = c(1, 3, 5), eps_global = 2)
Fixed Global Weights
globalweights_fix(n, r, w)
globalweights_fix(n, r, w)
n |
The sample size per basket. |
r |
Vector of responses. |
w |
Fixed number with wich all weights are multiplied |
A numeric value.
globalweights_fix(n = 20, r = c(1, 3, 5), w = 0.5)
globalweights_fix(n = 20, r = c(1, 3, 5), w = 0.5)
Conducts an interim analysis based on the posterior probability.
interim_posterior(design, ...) ## S4 method for signature 'TwoStageBasket' interim_posterior( design, n1, r1, weight_mat, globalweight_fun = NULL, globalweight_params = list(), prob_futstop = 0.1, prob_effstop = 0.9, ... )
interim_posterior(design, ...) ## S4 method for signature 'TwoStageBasket' interim_posterior( design, n1, r1, weight_mat, globalweight_fun = NULL, globalweight_params = list(), prob_futstop = 0.1, prob_effstop = 0.9, ... )
design |
An object of class |
... |
Further arguments. |
n1 |
The sample size per basket for the interim analysis in case of a two-stage design. |
r1 |
Vector of responses after the interim analysis. |
weight_mat |
The matrix with all weights. Automatically calculated
in the functions to which |
globalweight_fun |
Which function should be used to calculate the global weights. |
globalweight_params |
A list of tuning parameters specific to
|
prob_futstop |
Probability cut-off for stopping for futility. |
prob_effstop |
Probability cut-off for stopping for efficacy. |
interim_posterior
conducts an interim analysis with possible
stop for efficacy and futility based on the posterior probability. If the
posterior probability is less than prob_fustop
the basket is stopped
for futility, if the posterior probability is greater than
prob_effstop
the basket is stopped for efficacy. If
prob_fustop = 0
or prob_effstop = 1
then no futility-stop and
no efficacy stop is possible, respectively.
The function is generally not called by the user but passed to another
function such as toer
and pow
to specify which
interim analysis is conducted.
A vector with a length equal to the number of baskets with elements -1, 0 or 1 where -1 means stop for futility, 0 means continuation and 1 means stop for efficacy.
interim_posterior(TwoStageBasket)
: Interim analysis based on the posterior
probabilty for two-stage basket designs.
design <- setupTwoStageBasket(k = 3, p0 = 0.2) toer(design, n = 20, n1 = 10, lambda = 0.99, weight_fun = weights_fujikawa, interim_fun = interim_posterior, interim_params = list(prob_futstop = 0.05, prob_effstop = 0.95))
design <- setupTwoStageBasket(k = 3, p0 = 0.2) toer(design, n = 20, n1 = 10, lambda = 0.99, weight_fun = weights_fujikawa, interim_fun = interim_posterior, interim_params = list(prob_futstop = 0.05, prob_effstop = 0.95))
Conducts an interim analysis based on the posterior predictive probability.
interim_postpred(design, ...) ## S4 method for signature 'TwoStageBasket' interim_postpred( design, n, n1, r1, lambda, weight_mat, globalweight_fun = NULL, globalweight_params, prob_futstop = 0.1, prob_effstop = 0.9, ... )
interim_postpred(design, ...) ## S4 method for signature 'TwoStageBasket' interim_postpred( design, n, n1, r1, lambda, weight_mat, globalweight_fun = NULL, globalweight_params, prob_futstop = 0.1, prob_effstop = 0.9, ... )
design |
An object of class |
... |
Further arguments. |
n |
The sample size per basket. |
n1 |
The sample size per basket for the interim analysis in case of a two-stage design. |
r1 |
Vector of responses after the interim analysis. |
lambda |
The posterior probability threshold. See details for more information. |
weight_mat |
The matrix with all weights. Automatically calculated
in the functions to which |
globalweight_fun |
Which function should be used to calculate the global weights. |
globalweight_params |
A list of tuning parameters specific to
|
prob_futstop |
Probability cut-off for stopping for futility. |
prob_effstop |
Probability cut-off for stopping for efficacy. |
interim_postpred
conducts an interim analysis with possible
stop for efficacy and futility based on the posterior predictive probability.
If the posterior predictive probability is less than prob_fustop
the
basket is stopped for futility, if the posterior predictive probability is
greater than prob_effstop
the basket is stopped for efficacy. If
prob_fustop = 0
or prob_effstop = 1
then no futility-stop and
no efficacy stop is possible, respectively.
The function is generally not called by the user but passed to another
function such as toer
and pow
to specify which
interim analysis is conducted.
A vector with a length equal to the number of baskets with elements -1, 0 or 1 where -1 means stop for futility, 0 means continuation and 1 means stop for efficacy.
interim_postpred(TwoStageBasket)
: Interim analysis based on the posterior
predictive probabilty for two-stage basket designs.
design <- setupTwoStageBasket(k = 3, p0 = 0.2) toer(design, n = 20, n1 = 10, lambda = 0.99, interim_fun = interim_postpred, weight_fun = weights_fujikawa)
design <- setupTwoStageBasket(k = 3, p0 = 0.2) toer(design, n = 20, n1 = 10, lambda = 0.99, interim_fun = interim_postpred, weight_fun = weights_fujikawa)
OneStageBasket is an S4 class. An object of this class contains the most important design features of a single-stage basket trial.
This class implements a single-stage basket trial based on the power prior design or the design proposed by Fujikawa et al. In these designs, information is borrowed between baskets by calculating weights that reflect the similarity between the baskets (and optionally the overall heterogeneity). Posterior distributions for each basket are beta distributions where the parameters are found by adding weighted sums of the observed responses and non-responses in each basket to the prior parameters (or in case of Fujikawa's design by calculating weighted sums of the individual posterior distributions).
Currently only common prior distributions and a common null hypothesis are supported.
k
The number of baskets.
shape1
First common shape parameter of the beta prior.
shape2
Second common shape parameter of the beta prior.
p0
A common probability under the null hypothesis.
Baumann, L., Sauer, L., & Kieser, M. (2024). A basket trial design based on power priors. arXiv:2309.06988.
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.
Finds the optimal tuning parameters using grid search.
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, ... )
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, ... )
design |
An object of class |
... |
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
|
globalweight_fun |
Which function should be used to calculate the global weights. |
globalweight_params |
A list of tuning parameters specific to
|
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 |
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
|
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
.
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.
opt_design(OneStageBasket)
: Optimize a single-stage basket design.
opt_design(TwoStageBasket)
: Optimize a two-stage basket design.
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)
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)
Plot Weight Functions
plot_weights(design, ...) ## S4 method for signature 'OneStageBasket' plot_weights(design, n, r1, weight_fun, weight_params = list(), ...)
plot_weights(design, ...) ## S4 method for signature 'OneStageBasket' plot_weights(design, n, r1, weight_fun, weight_params = list(), ...)
design |
An object of class |
... |
Further arguments. |
n |
The sample size per basket. |
r1 |
Number of responses in one basket |
weight_fun |
Which function should be used to calculate the pairwise weights. |
weight_params |
A list of tuning parameters specific to
|
The design object is only used for the prior parameters, which affect the weights of some weight functions.
A plot.
plot_weights(OneStageBasket)
: Plot weights for a single-stage basket trials
design <- setupOneStageBasket(k = 3, p0 = 0.2, shape1 = 1, shape2 = 1) plot_weights(design = design, n = 20, r1 = 10, weight_fun = weights_jsd)
design <- setupOneStageBasket(k = 3, p0 = 0.2, shape1 = 1, shape2 = 1) plot_weights(design = design, n = 20, r1 = 10, weight_fun = weights_jsd)
Computes the exact power for a basket trial.
pow(design, ...) ## S4 method for signature 'OneStageBasket' pow( design, p1, n, lambda, weight_fun, weight_params = list(), globalweight_fun = NULL, globalweight_params = list(), results = c("ewp", "group"), ... ) ## S4 method for signature 'TwoStageBasket' pow( design, p1, n, n1, lambda, interim_fun, interim_params = list(), weight_fun, weight_params = list(), globalweight_fun = NULL, globalweight_params = list(), results = c("ewp", "group"), ... )
pow(design, ...) ## S4 method for signature 'OneStageBasket' pow( design, p1, n, lambda, weight_fun, weight_params = list(), globalweight_fun = NULL, globalweight_params = list(), results = c("ewp", "group"), ... ) ## S4 method for signature 'TwoStageBasket' pow( design, p1, n, n1, lambda, interim_fun, interim_params = list(), weight_fun, weight_params = list(), globalweight_fun = NULL, globalweight_params = list(), results = c("ewp", "group"), ... )
design |
An object of class |
... |
Further arguments. |
p1 |
Probabilities under the alternative hypothesis. If
|
n |
The sample size per basket. |
lambda |
The posterior probability threshold. See details for more information. |
weight_fun |
Which function should be used to calculate the pairwise weights. |
weight_params |
A list of tuning parameters specific to
|
globalweight_fun |
Which function should be used to calculate the global weights. |
globalweight_params |
A list of tuning parameters specific to
|
results |
Whether only the experimentwise power (option |
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
|
pow
computes the exact experimentwise power and the
exact rejection probabilities per group. The experimentwise power
is the probability to reject at least one null hypothesis for a basket with
p1 > p0. The rejection probabilities correspond to the type 1 error
rate for baskets with p1 = p0 and to the power for baskets with
p1 > p0.
This method is implemented for the class OneStageBasket
.
If results = "ewp"
then the experimentwise power is
returned as a numeric value. If results = "group"
then a list with
the rejection probabilities per group and the experimentwise power
is returned. For baskets with p1 = p0 the rejection probabilities
corresponds to the type 1 error rate, for baskets with p1 > p0 the
rejection probabilities corresponds to the power.
pow(OneStageBasket)
: Power for a single-stage basket design.
pow(TwoStageBasket)
: Power for a two-stage basket design.
design <- setupOneStageBasket(k = 3, p0 = 0.2) pow(design, p1 = c(0.2, 0.5, 0.5), n = 15, lambda = 0.99, weight_fun = weights_fujikawa, weight_params = list(epsilon = 2, tau = 0))
design <- setupOneStageBasket(k = 3, p0 = 0.2) pow(design, p1 = c(0.2, 0.5, 0.5), n = 15, lambda = 0.99, weight_fun = weights_fujikawa, weight_params = list(epsilon = 2, tau = 0))
Creates an object of class OneStageBasket
.
setupOneStageBasket(k, shape1 = 1, shape2 = 1, p0)
setupOneStageBasket(k, shape1 = 1, shape2 = 1, p0)
k |
The number of baskets. |
shape1 |
First common shape parameter of the beta prior. |
shape2 |
Second common shape parameter of the beta prior. |
p0 |
A common probability under the null hypothesis. |
A OneStageBasket
object contains the most important
design features of a basket trial. Currently only common prior distributions
and a common null hypothesis are supported.
An S4 object of class OneStageBasket
.
design <- setupOneStageBasket(k = 3, p0 = 0.2)
design <- setupOneStageBasket(k = 3, p0 = 0.2)
Creates an object of class TwoStageBasket
.
setupTwoStageBasket(k, shape1 = 1, shape2 = 1, p0)
setupTwoStageBasket(k, shape1 = 1, shape2 = 1, p0)
k |
The number of baskets. |
shape1 |
First common shape parameter of the beta prior. |
shape2 |
Second common shape parameter of the beta prior. |
p0 |
A common probability under the null hypothesis. |
A TwoStageBasket
object contains the most important
design features of a basket trial. Currently only common prior distributions
and a common null hypothesis are supported.
An S4 object of class TwoStageBasket
.
design <- setupTwoStageBasket(k = 3, p0 = 0.2)
design <- setupTwoStageBasket(k = 3, p0 = 0.2)
Computes the exact family wise type 1 error rate of a basket trial .
toer(design, ...) ## S4 method for signature 'OneStageBasket' toer( design, p1 = NULL, n, lambda, weight_fun, weight_params = list(), globalweight_fun = NULL, globalweight_params = list(), results = c("fwer", "group"), ... ) ## S4 method for signature 'TwoStageBasket' toer( design, p1 = NULL, n, n1, lambda, interim_fun, interim_params = list(), weight_fun, weight_params = list(), globalweight_fun = NULL, globalweight_params = list(), results = c("fwer", "group"), ... )
toer(design, ...) ## S4 method for signature 'OneStageBasket' toer( design, p1 = NULL, n, lambda, weight_fun, weight_params = list(), globalweight_fun = NULL, globalweight_params = list(), results = c("fwer", "group"), ... ) ## S4 method for signature 'TwoStageBasket' toer( design, p1 = NULL, n, n1, lambda, interim_fun, interim_params = list(), weight_fun, weight_params = list(), globalweight_fun = NULL, globalweight_params = list(), results = c("fwer", "group"), ... )
design |
An object of class |
... |
Further arguments. |
p1 |
Probabilities under the alternative hypothesis. If
|
n |
The sample size per basket. |
lambda |
The posterior probability threshold. See details for more information. |
weight_fun |
Which function should be used to calculate the pairwise weights. |
weight_params |
A list of tuning parameters specific to
|
globalweight_fun |
Which function should be used to calculate the global weights. |
globalweight_params |
A list of tuning parameters specific to
|
results |
Whether only the family wise error rate (option |
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
|
toer
computes the exact family wise type 1 error rate and the
exact rejection probabilities per group. The family wise type 1 error rate
is the probability to reject at least one null hypothesis for a basket with
p1 = p0. If all p1 > p0 then the family wise type 1 error
rate under the global null hypothesis is computed. The rejection
probabilities correspond to the type 1 error rate for baskets with p1 =
p0 and to the power for baskets with p1 > p0.
If results = "fwer"
then the family wise type 1 error rate is
returned as a numeric value. If results = "group"
then a list with
the rejection probabilities per group and the family wise type 1 error rate
is returned. If all p1 > p0 then the family wise type 1 error rate
is calculated under the global null hypothesis. For baskets with p1 =
p0 the rejection probabilities corresponds to the type 1 error rate, for
baskets with p1 > p0 the rejection probabilities corresponds to the
power.
toer(OneStageBasket)
: Type 1 error rate for a single-stage basket design.
toer(TwoStageBasket)
: Type 1 error rate for two-stage basket design.
design <- setupOneStageBasket(k = 3, p0 = 0.2) toer(design, n = 15, lambda = 0.99, weight_fun = weights_fujikawa)
design <- setupOneStageBasket(k = 3, p0 = 0.2) toer(design, n = 15, lambda = 0.99, weight_fun = weights_fujikawa)
TwoStageBasket is an S4 class. An object of this class contains the most important design features of a two-stage basket trial.
This class implements a two-stage basket trial based on the power prior design or the design proposed by Fujikawa et al. In these designs, information is borrowed between baskets by calculating weights that reflect the similarity between the baskets (and optionally the overall heterogeneity). Posterior distributions for each basket are beta distributions where the parameters are found by adding weighted sums of the observed responses and non-responses in each basket to the prior parameters (or in case of Fujikawa's design by calculating weighted sums of the individual posterior distributions).
k
The number of baskets.
shape1
First common shape parameter of the beta prior.
shape2
Second common shape parameter of the beta prior.
p0
A common probability under the null hypothesis.
Baumann, L., Sauer, L., & Kieser, M. (2024). A basket trial design based on power priors. arXiv:2309.06988.
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.
Weights Based on the Calibrated Power Prior
weights_cpp(design, ...) ## S4 method for signature 'OneStageBasket' weights_cpp( design, n, a = 1, b = 1, prune = FALSE, lambda, globalweight_fun = NULL, globalweight_params = list(), ... ) ## S4 method for signature 'TwoStageBasket' weights_cpp(design, n, n1, a = 1, b = 1, ...)
weights_cpp(design, ...) ## S4 method for signature 'OneStageBasket' weights_cpp( design, n, a = 1, b = 1, prune = FALSE, lambda, globalweight_fun = NULL, globalweight_params = list(), ... ) ## S4 method for signature 'TwoStageBasket' weights_cpp(design, n, n1, a = 1, b = 1, ...)
design |
An object of class |
... |
Further arguments. |
n |
The sample size per basket. |
a |
first tuning parameter |
b |
second tuning parameter |
prune |
Whether baskets with a number of responses below the
critical pooled value should be pruned before the final analysis.
If this is |
lambda |
The posterior probability threshold. See details for more information. |
globalweight_fun |
Which function should be used to calculate the global weights. |
globalweight_params |
A list of tuning parameters specific to
|
n1 |
The sample size per basket for the interim analysis in case of a two-stage design. |
weights_cpp
calculates the weights based on an approach
by Pan & Yuan (2017). The weight for two baskets i and j is found by at
first calculating as the Kolmogorov-Smirnov statistic,
which is equal to the difference in response rates for binary variables.
is then transformed to
.
Then the weight is found as
, where
a and b are tuning parameters.
The function is generally not called by the user but passed to another
function such as toer
and pow
to specificy
how the weights are calculated.
A matrix including the weights of all possible pairwise outcomes.
weights_cpp(OneStageBasket)
: Calibrated power prior weights for a single-stage
basket design.
weights_cpp(TwoStageBasket)
: Calibrated power prior weights for a two-stage
basket design.
Baumann, L., Sauer, L., & Kieser, M. (2024). A basket trial design based on power priors. arXiv:2309.06988.
Pan, H., Yuan, Y., & Xia, J. (2017). A calibrated power prior approach to borrow information from historical data with application to biosimilar clinical trials. Journal of the Royal Statistical Society Series C: Applied Statistics, 66(5), 979-996.
design <- setupOneStageBasket(k = 3, p0 = 0.2) toer(design, n = 15, lambda = 0.99, weight_fun = weights_cpp)
design <- setupOneStageBasket(k = 3, p0 = 0.2) toer(design, n = 15, lambda = 0.99, weight_fun = weights_cpp)
Weights Based on Fujikawa et al.'s Design
weights_fujikawa(design, ...) ## S4 method for signature 'OneStageBasket' weights_fujikawa( design, n, lambda, epsilon = 1.25, tau = 0.5, logbase = 2, prune = FALSE, globalweight_fun = NULL, globalweight_params = list(), ... ) ## S4 method for signature 'TwoStageBasket' weights_fujikawa(design, n, n1, epsilon = 1.25, tau = 0, logbase = 2, ...)
weights_fujikawa(design, ...) ## S4 method for signature 'OneStageBasket' weights_fujikawa( design, n, lambda, epsilon = 1.25, tau = 0.5, logbase = 2, prune = FALSE, globalweight_fun = NULL, globalweight_params = list(), ... ) ## S4 method for signature 'TwoStageBasket' weights_fujikawa(design, n, n1, epsilon = 1.25, tau = 0, logbase = 2, ...)
design |
An object of class |
... |
Further arguments. |
n |
The sample size per basket. |
lambda |
The posterior probability threshold. See details for more information. |
epsilon |
A tuning parameter that determines the amount of borrowing. See details for more information. |
tau |
A tuning parameter that determines how similar the baskets have to be that borrowing occurs. See details for more information. |
logbase |
A tuning parameter that determines which logarithm base is used to compute the Jensen-Shannon divergence. See details for more information. |
prune |
Whether baskets with a number of responses below the
critical pooled value should be pruned before the final analysis.
If this is |
globalweight_fun |
Which function should be used to calculate the global weights. |
globalweight_params |
A list of tuning parameters specific to
|
n1 |
The sample size per basket for the interim analysis in case of a two-stage design. |
weights_fujikawa
calculates the weights used for sharing
information between baskets based on the proposal by Fujikawa et al. (2020).
The weight for two baskets i and j is found as
where
is the Jensen-Shannon
divergence between the individual posterior distributions of the response
probabilities of basket i and j. Note that Fujikawa's weights also share the
prior information between the baskets.
A small value of epsilon results in stronger borrowing also across baskets with heterogenous results. If epsilon is large then information is only borrowed between baskets with similar results. If a weight is smaller than tau it is set to 0, which results in no borrowing.
If prune = TRUE
then the baskets with an observed number of baskets
smaller than the pooled critical value are not borrowed from. The
pooled critical value is the smallest integer c for which all null
hypotheses can be rejected if the number of responses is exactly c for
all baskets.
The function is generally not called by the user but passed to another
function such as toer
and pow
to specificy
how the weights are calculated.
A matrix including the weights of all possible pairwise outcomes.
weights_fujikawa(OneStageBasket)
: Fujikawa-weights for a single-stage basket
design.
weights_fujikawa(TwoStageBasket)
: Fujikawa-weights for a two-stage basket design.
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 <- setupOneStageBasket(k = 3, p0 = 0.2) toer(design, n = 15, lambda = 0.99, weight_fun = weights_fujikawa)
design <- setupOneStageBasket(k = 3, p0 = 0.2) toer(design, n = 15, lambda = 0.99, weight_fun = weights_fujikawa)
Weights Based on the Jensen-Shannon Divergence
weights_jsd(design, ...) ## S4 method for signature 'OneStageBasket' weights_jsd( design, n, lambda, epsilon = 1.25, tau = 0.5, logbase = 2, prune = FALSE, globalweight_fun = NULL, globalweight_params = list(), ... ) ## S4 method for signature 'TwoStageBasket' weights_jsd(design, n, n1, epsilon = 1.25, tau = 0, logbase = 2, ...)
weights_jsd(design, ...) ## S4 method for signature 'OneStageBasket' weights_jsd( design, n, lambda, epsilon = 1.25, tau = 0.5, logbase = 2, prune = FALSE, globalweight_fun = NULL, globalweight_params = list(), ... ) ## S4 method for signature 'TwoStageBasket' weights_jsd(design, n, n1, epsilon = 1.25, tau = 0, logbase = 2, ...)
design |
An object of class |
... |
Further arguments. |
n |
The sample size per basket. |
lambda |
The posterior probability threshold. See details for more information. |
epsilon |
A tuning parameter that determines the amount of borrowing. See details for more information. |
tau |
A tuning parameter that determines how similar the baskets have to be that borrowing occurs. See details for more information. |
logbase |
A tuning parameter that determines which logarithm base is used to compute the Jensen-Shannon divergence. See details for more information. |
prune |
Whether baskets with a number of responses below the
critical pooled value should be pruned before the final analysis.
If this is |
globalweight_fun |
Which function should be used to calculate the global weights. |
globalweight_params |
A list of tuning parameters specific to
|
n1 |
The sample size per basket for the interim analysis in case of a two-stage design. |
weights_jsd
calculates the weights used for sharing
information between baskets based on the Jensen-Shannon divergence (JSD).
The weight for two baskets i and j is found as
where
is the Jensen-Shannon
divergence between the individual posterior distributions of the response
probabilities of basket i and j. This is identical to how the weights are
calculated in
weights_fujikawa
, however when Fujikawa's weights
are used the prior information is also shared.
A small value of epsilon results in stronger borrowing also across baskets with heterogenous results. If epsilon is large then information is only borrowed between baskets with similar results. If a weight is smaller than tau it is set to 0, which results in no borrowing.
If prune = TRUE
then the baskets with an observed number of baskets
smaller than the pooled critical value are not borrowed from. The
pooled critical value is the smallest integer c for which all null
hypotheses can be rejected if the number of responses is exactly c for
all baskets.
The function is generally not called by the user but passed to another
function such as toer
and pow
to specificy
how the weights are calculated.
A matrix including the weights of all possible pairwise outcomes.
weights_jsd(OneStageBasket)
: Jensen-Shannon Divergence weights for a
single-stage basket design.
weights_jsd(TwoStageBasket)
: Jensen-Shannon Divergence weights for a two-stage
basket design.
design <- setupOneStageBasket(k = 3, p0 = 0.2) toer(design, n = 15, lambda = 0.99, weight_fun = weights_jsd)
design <- setupOneStageBasket(k = 3, p0 = 0.2) toer(design, n = 15, lambda = 0.99, weight_fun = weights_jsd)
Weights Based on the Marginal Maximum Likelihood
weights_mml(design, ...) ## S4 method for signature 'OneStageBasket' weights_mml( design, n, prune = FALSE, lambda, globalweight_fun = NULL, globalweight_params = list(), ... ) ## S4 method for signature 'TwoStageBasket' weights_mml(design, n, n1, ...)
weights_mml(design, ...) ## S4 method for signature 'OneStageBasket' weights_mml( design, n, prune = FALSE, lambda, globalweight_fun = NULL, globalweight_params = list(), ... ) ## S4 method for signature 'TwoStageBasket' weights_mml(design, n, n1, ...)
design |
An object of class |
... |
Further arguments. |
n |
The sample size per basket. |
prune |
Whether baskets with a number of responses below the
critical pooled value should be pruned before the final analysis.
If this is |
lambda |
The posterior probability threshold. See details for more information. |
globalweight_fun |
Which function should be used to calculate the global weights. |
globalweight_params |
A list of tuning parameters specific to
|
n1 |
The sample size per basket for the interim analysis in case of a two-stage design. |
weights_mml
calculates the weights based on the marginal
maximum likelihood approach by Gravestock & Held (2017). In this approach,
the weight is found as the maximum of the marginal likelihood of the
weight-parameter given the dataset that information should be borrowed
from. However, since this can lead to non-symmetric weights (meaning that
the amount of information that data set 1 borrows from data set 2 is
generally not identical to the information data set 2 borrows from data set
1), a symmetrised version is used here: For the sharing-weight of
Basket 1 and Basket 2 the MML is calculted two times - once conditional
on the data of Basket 1 and once conditional on the data of Basket 2.
The mean of these two weights is then used, resulting in symmetrical
sharing.
A matrix including the weights of all possible pairwise outcomes.
weights_mml(OneStageBasket)
: Maximum marginal likelihood weights for a
single-stage basket design
weights_mml(TwoStageBasket)
: Maximum marginal likelihood weights for a
two-stage basket design
Gravestock, I., & Held, L. (2017). Adaptive power priors with empirical Bayes for clinical trials. Pharmaceutical statistics, 16(5), 349-360.
design <- setupOneStageBasket(k = 3, p0 = 0.2) toer(design, n = 15, lambda = 0.99, weight_fun = weights_mml)
design <- setupOneStageBasket(k = 3, p0 = 0.2) toer(design, n = 15, lambda = 0.99, weight_fun = weights_mml)
Pooled Analysis
weights_pool(design, ...) ## S4 method for signature 'OneStageBasket' weights_pool(design, n, ...) ## S4 method for signature 'TwoStageBasket' weights_pool(design, n, n1, ...)
weights_pool(design, ...) ## S4 method for signature 'OneStageBasket' weights_pool(design, n, ...) ## S4 method for signature 'TwoStageBasket' weights_pool(design, n, n1, ...)
design |
An object of class |
... |
Further arguments. |
n |
The sample size per basket. |
n1 |
The sample size per basket for the interim analysis in case of a two-stage design. |
When weights_pool
is used as a weight function, all data
are pooled.
A weight matrix where all weights are 1.
weights_pool(OneStageBasket)
: Pooled analysis for a single-stage basket design
weights_pool(TwoStageBasket)
: Pooled analysis for a two-stage basket design
design <- setupOneStageBasket(k = 3, p0 = 0.2) toer(design, n = 15, lambda = 0.99, weight_fun = weights_pool)
design <- setupOneStageBasket(k = 3, p0 = 0.2) toer(design, n = 15, lambda = 0.99, weight_fun = weights_pool)
Separate Analysis in Each Basket
weights_separate(design, ...) ## S4 method for signature 'OneStageBasket' weights_separate(design, n, ...) ## S4 method for signature 'TwoStageBasket' weights_separate(design, n, n1, ...)
weights_separate(design, ...) ## S4 method for signature 'OneStageBasket' weights_separate(design, n, ...) ## S4 method for signature 'TwoStageBasket' weights_separate(design, n, n1, ...)
design |
An object of class |
... |
Further arguments. |
n |
The sample size per basket. |
n1 |
The sample size per basket for the interim analysis in case of a two-stage design. |
When weights_separate
is used as a weight function, a
separate analysis performed in each basket.
A weight matrix where all weights are 0.
weights_separate(OneStageBasket)
: Separate analysis for a single-stage basket
design
weights_separate(TwoStageBasket)
: Separate analysis for a two-stage basket
design
design <- setupOneStageBasket(k = 3, p0 = 0.2) toer(design, n = 15, lambda = 0.99, weight_fun = weights_separate)
design <- setupOneStageBasket(k = 3, p0 = 0.2) toer(design, n = 15, lambda = 0.99, weight_fun = weights_separate)