Calculates borrowing weights for a hybrid control arm using one of several dynamic borrowing methods.
borrow.wt(
Yc,
nc,
Ych,
nch,
nche,
a0c = 0.001,
b0c = 0.001,
delta_threshold = 0.1,
method = "Empirical Bayes",
theta = 0.5,
eta = 1
)A list containing three values:
a: The global borrowing weight, calculated as nche / nch.
wd: The dynamic borrowing weight, calculated based on the chosen method.
w: The final overall borrowing weight, which is a product of a,
wd, and an indicator for whether the response rates are sufficiently similar.
A scalar integer. The number of responders in the current control arm.
A scalar integer. The number of subjects in the current control arm.
A scalar integer. The number of responders in the historical control arm.
A scalar integer. The number of subjects in the historical control arm.
A scalar. The maximum number of subjects that can be borrowed,
used to calculate the global weight a.
Numerics. Hyperparameters for the Beta(a0c, b0c) prior on the control response rate. Default to 0.001.
A numeric threshold. Borrowing is only triggered if the absolute difference in observed response rates is less than this value. Default is 0.1.
A string specifying the dynamic borrowing method. Options include "Empirical Bayes", "Bayesian p", "Generalized BC", "JSD".
A numeric scalar in (0, 1), applicable to the "Generalized BC" method. Default is 0.5.
A numeric scalar, applicable to the "Bayesian p", "Generalized BC", and "JSD" methods. Default is 1.
The function implements the following methods:
"Empirical Bayes": The weight is determined by maximizing the marginal likelihood of the current data.
"Bayesian p": Similarity is measured by a Bayesian p-value comparing the posterior distributions.
"Generalized BC": Uses the Generalized Bhattacharyya Coefficient. The standard BC is a special case with theta = 0.5.
"JSD": Uses the Jensen-Shannon Divergence to measure similarity.
# \donttest{
borrow.wt(Yc=12, nc=40, Ych=54, nch=180, nche=40, a0c=0.001,
b0c=0.001, delta_threshold=0.1, eta=1)
# }
Run the code above in your browser using DataLab