weights_cpp {baskexact}  R Documentation 
Weights Based on the Calibrated Power Prior
Description
Weights Based on the Calibrated Power Prior
Usage
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, ...)
Arguments
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 twostage design. 
Details
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 S_{KS;i,j}
as the KolmogorovSmirnov statistic,
which is equal to the difference in response rates for binary variables.
S_{KS;i,j}
is then transformed to S_{i,j} = n^{1/4}S_{KS;i,j}
.
Then the weight is found as 1 / (1 + exp(a + b * log(S_{i,j})))
, 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.
Value
A matrix including the weights of all possible pairwise outcomes.
Methods (by class)

weights_cpp(OneStageBasket)
: Calibrated power prior weights for a singlestage basket design. 
weights_cpp(TwoStageBasket)
: Calibrated power prior weights for a twostage basket design.
References
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), 979996.
Examples
design < setupOneStageBasket(k = 3, p0 = 0.2)
toer(design, n = 15, lambda = 0.99, weight_fun = weights_cpp)