Package 'BAR'

Title: Bayesian Adaptive Randomization
Description: Bayesian adaptive randomization is also called outcome adaptive randomization, which is increasingly used in clinical trials.
Authors: Chia-Wei Hsu [aut, cre], Haitao Pan [aut]
Maintainer: Chia-Wei Hsu <[email protected]>
License: GPL-2
Version: 0.1.1
Built: 2024-11-12 06:44:45 UTC
Source: CRAN

Help Index


Generate operating characteristics for Bayesian adaptive randomization

Description

Randomization is the established method for obtaining scientifically valid comparisons of competing treatments in clinical trials and other experiments. Bayesian adaptive randomization (BAR) allows changes to be made to the randomization probabilities to treatments during the trial. The aim of the procedure is to allocate a greater proportion of patients to treatments that have so far demonstrated evidence of a better performance than other arms. Binary outcomes are considered in this package

Usage

get_oc_BAR(success_prob, n_burn_in, tot_num, block_size,
           power_c = "n/2N", lower_bound = .05, reptime,
           control_arm = "", output = "", seed = 100)

Arguments

success_prob

the successful probability for each arm (the first slot refers to the control arm)

n_burn_in

the number of burn-in for each arm

tot_num

the total number of patients enrolled for the trial

block_size

the block size

power_c

the power correction of allocation probability. The default value is power_c = "n/2N" and can also be numeric, e.g., power_c = .5

lower_bound

the lower bound of the allocation probability. It must between 0 and 1K\frac{1}{K}. The default value is lower_bound = .05; K indicates total number of arms (including control arm)

reptime

the number of simulated trials

control_arm

if this argument is "fixed", then allocation probability of control arm (the first slot) will be fixed to 1K\frac{1}{K}. The default of this argument will return unfixed results; K indicates total number of arms (including control arm)

output

if this argument is "raw", then the function will return updated allocation probability path after burn-in for each arm for each simulated trial. The default of this argument will return the average allocation probability and the average number of patients assigned to each arm

seed

the seed. The default value is seed = 100

Details

We show how the updated allocation probabilities for each arm are calculated.

Treatments are denoted by k=1,,Kk = 1,\ldots,K.  N\;N is the total sample size. If no burn-in(s), the BAR will be initiated start of a study, that is, for each enrolled patient, n=1,,N,n = 1,\ldots,N, the BAR will be used to assign each patient. Denoting the true unknown response rates of KK treatments by π1,,πK,  \pi_{1},\ldots,\pi_{K},\;we can compute KK posterior probabilities: rk,n=Pr(πk=max{π1,,πK}    Datan)r_{k,n} = Pr(\pi_{k} = max\{\pi_{1},\ldots,\pi_{K}\}\;|\;Data_{n}), here, nn refers to the nn-th patient and kk refers to the kk-th arm. We calculate the updated probabilities of the BAR algorithm according to the following steps.
  \;
Step 1: (Normalization) Normalize rk,nr_{k,n} as rk,n(c)=(rk,n)cj=1K(rj,n)cr_{k,n}^{(c)} = \frac{(r_{k,n})^{c}}{\sum_{j=1}^{K}(r_{j,n})^{c}}, here   c=n2N\;c = \frac{n}{2N}.

Step 2: (Restriction) To avoid the BAR sticking to very low/high probabilities, a restriction rule to the posterior probability rk,n(c)r_{k,n}^{(c)} will be applied:

Lower  Boundrk,n(c)1(K1)×Lower  Bound,Lower\;Bound \le r_{k,n}^{(c)} \le 1 - (K - 1) \times Lower\;Bound,

0Lower  Bound1K0 \le Lower\;Bound \le \frac{1}{K}

After restriction, the posterior probability is denoted as rk,n(c,re)r_{k,n}^{(c,re)}.

Step 3: (Re-normalization) Then, we can have the updated allocation probabilities by the BAR denoted as:

rk,n(f)=rk,n(c,re)×(rk,n(c,re)nkn)2j=1K{rj,n(c,re)×(rj,n(c,re)njn)2}r_{k,n}^{(f)} = \frac{r_{k,n}^{(c,re)}\times(\frac{r_{k,n}^{(c,re)}}{\frac{n_{k}}{n}})^{2}}{\sum_{j=1}^{K}\{r_{j,n}^{(c,re)}\times(\frac{r_{j,n}^{(c,re)}}{\frac{n_{j}}{n}})^{2}\}}

where nkn_{k} is the number of patients enrolled on arm kk up-to-now.

Step 4: (Re-restriction) Finally, restricts again by using

Lower  Boundrk,n(f)1(K1)×Lower  Bound,Lower\;Bound \le r_{k,n}^{(f)} \le 1 - (K-1) \times Lower\;Bound,

0Lower  Bound1K0 \le Lower\;Bound \le \frac{1}{K}

and denote rk,n(ff)r_{k,n}^{(ff)} as the allocation probability used in the BAR package.

Value

get_oc_BAR() depending on the argument "output", it returns:

default: (1) the average allocation probability (2) the average number of patients assigned to each arm

raw: (1) updated allocation probability path after burn-in for each arm for each simulated trial

Author(s)

Chia-Wei Hsu, Haitao Pan

References

Wathen JK, Thall PF. A simulation study of outcome adaptive randomization in multi-arm clinical trials. Clin Trials. 2017 Oct; 14(5): 432-440. doi: 10.1177/1740774517692302.

Xiao, Y., Liu, Z. & Hu, F. Bayesian doubly adaptive randomization in clinical trials. Sci. China Math. 60, 2503-2514 (2017). doi: 10.1007/s11425-016-0056-1.

Hu F, Zhang L X. Asymptotic properties of doubly adaptive biased coin designs for multi-treatment clinical trials. Ann Statist, 2004, 30: 268–301.

Examples

## power_c = "n/2N"
get_oc_BAR(success_prob = c(.1, .5, .8), n_burn_in = 10,
           tot_num = 150, block_size = 1, reptime = 5)

## power_c = .5
get_oc_BAR(success_prob = c(.1, .5, .8), n_burn_in = 10,
           tot_num = 150, block_size = 1, power_c = .5,
           reptime = 5)

Calculate the allocation probability for the next block of new patients using Bayesian adaptive randomization

Description

Calculate updated allocation probability for each arm based on the accumulative data with binary outcomes

Usage

next_allocation_rate_BAR(n, success_count, tot_num,
                         power_c = "n/2N",
                         lower_bound = .05,
                         control_arm = "",
                         seed = 100)

Arguments

n

the number of patients enrolled for each arm

success_count

the number of responders for each arm

tot_num

the total number of patients enrolled for the trial. If this number cannot be pre-planned, the user can choose argument "power_c" to be numeric instead of "n/2N". In this case, even if the "tot_num" is given a number, this number will not be used

power_c

the power correction of allocation probability. The default value is power_c = "n/2N" and can also be numeric, e.g., power_c = .5

lower_bound

the lower bound of the allocation probability. It must between 0 and 1K\frac{1}{K}. The default value is lower_bound = .05; K indicates total number of arms (including control arm)

control_arm

if this argument is "fixed", then allocation probability of control arm (the first slot) will be fixed to 1K\frac{1}{K}. The default of this argument will return unfixed results; K indicates total number of arms (including control arm)

seed

the seed. The default value is seed = 100

Details

We show how the updated allocation probabilities for each arm are calculated.

Treatments are denoted by k=1,,Kk = 1,\ldots,K.  N\;N is the total sample size. If no burn-in(s), the BAR will be initiated start of a study, that is, for each enrolled patient, n=1,,N,n = 1,\ldots,N, the BAR will be used to assign each patient. Denoting the true unknown response rates of KK treatments by π1,,πK,  \pi_{1},\ldots,\pi_{K},\;we can compute KK posterior probabilities: rk,n=Pr(πk=max{π1,,πK}    Datan)r_{k,n} = Pr(\pi_{k} = max\{\pi_{1},\ldots,\pi_{K}\}\;|\;Data_{n}), here, nn refers to the nn-th patient and kk refers to the kk-th arm. We calculate the updated probabilities of the BAR algorithm according to the following steps.
  \;
Step 1: (Normalization) Normalize rk,nr_{k,n} as rk,n(c)=(rk,n)cj=1K(rj,n)cr_{k,n}^{(c)} = \frac{(r_{k,n})^{c}}{\sum_{j=1}^{K}(r_{j,n})^{c}}, here   c=n2N\;c = \frac{n}{2N}.

Step 2: (Restriction) To avoid the BAR sticking to very low/high probabilities, a restriction rule to the posterior probability rk,n(c)r_{k,n}^{(c)} will be applied:

Lower  Boundrk,n(c)1(K1)×Lower  Bound,Lower\;Bound \le r_{k,n}^{(c)} \le 1 - (K - 1) \times Lower\;Bound,

0Lower  Bound1K0 \le Lower\;Bound \le \frac{1}{K}

After restriction, the posterior probability is denoted as rk,n(c,re)r_{k,n}^{(c,re)}.

Step 3: (Re-normalization) Then, we can have the updated allocation probabilities by the BAR denoted as:

rk,n(f)=rk,n(c,re)×(rk,n(c,re)nkn)2j=1K{rj,n(c,re)×(rj,n(c,re)njn)2}r_{k,n}^{(f)} = \frac{r_{k,n}^{(c,re)}\times(\frac{r_{k,n}^{(c,re)}}{\frac{n_{k}}{n}})^{2}}{\sum_{j=1}^{K}\{r_{j,n}^{(c,re)}\times(\frac{r_{j,n}^{(c,re)}}{\frac{n_{j}}{n}})^{2}\}}

where nkn_{k} is the number of patients enrolled on arm kk up-to-now.

Step 4: (Re-restriction) Finally, restricts again by using

Lower  Boundrk,n(f)1(K1)×Lower  Bound,Lower\;Bound \le r_{k,n}^{(f)} \le 1 - (K-1) \times Lower\;Bound,

0Lower  Bound1K0 \le Lower\;Bound \le \frac{1}{K}

and denote rk,n(ff)r_{k,n}^{(ff)} as the allocation probability used in the BAR package.

Value

next_allocation_rate_BAR() returns the updated allocation probability for each arm

Author(s)

Chia-Wei Hsu, Haitao Pan

References

Wathen JK, Thall PF. A simulation study of outcome adaptive randomization in multi-arm clinical trials. Clin Trials. 2017 Oct; 14(5): 432-440. doi: 10.1177/1740774517692302.

Xiao, Y., Liu, Z. & Hu, F. Bayesian doubly adaptive randomization in clinical trials. Sci. China Math. 60, 2503-2514 (2017). doi: 10.1007/s11425-016-0056-1.

Hu F, Zhang L X. Asymptotic properties of doubly adaptive biased coin designs for multi-treatment clinical trials. Ann Statist, 2004, 30: 268–301.

Examples

## power_c = "n/2N"
next_allocation_rate_BAR(n = c(30, 30, 30),
                         success_count = c(5, 6, 12),
                         tot_num = 150)

## power_c = .5
next_allocation_rate_BAR(n = c(30, 30, 30),
                         success_count = c(5, 6, 12),
                         tot_num = 150, power_c = .5)