brar_select_au_binary {RARtrials}R Documentation

Select au in Bayesian Response-Adaptive Randomization with a Control Group for Binary Endpoint

Description

brar_select_au_binary involves selecting au in Bayesian Response-Adaptive Randomization with a control group for binary outcomes with two to five arms. The conjugate prior distributions follow Beta (Beta(\alpha,\beta)) distributions and can be specified individually for each arm.

Usage

brar_select_au_binary(
  Pats,
  nMax,
  TimeToOutcome,
  enrollrate,
  N1,
  armn,
  h,
  N2,
  tp,
  armlabel,
  blocksize,
  alpha1 = 1,
  beta1 = 1,
  alpha2 = alpha1,
  beta2 = beta1,
  alpha3 = alpha1,
  beta3 = beta1,
  alpha4 = alpha1,
  beta4 = beta1,
  alpha5 = alpha1,
  beta5 = beta1,
  minstart,
  deltaa,
  tpp = 0,
  deltaa1,
  side,
  output = NULL,
  ...
)

Arguments

Pats

the number of patients accrued within a certain time frame indicates the count of individuals who have been affected by the disease during that specific period, for example, a month or a day. If this number is 10, it represents that 10 people have got the disease within the specified time frame.

nMax

the assumed maximum accrued number of patients with the disease in the population, this number should be chosen carefully to ensure a sufficient number of patients are simulated, especially when considering the delay mechanism.

TimeToOutcome

the distribution of delayed response times or a fixed delay time for responses. The delayed time could be a month, a week or any other time frame. When the unit changes, the number of TimeToOutcome should also change. It can be in the format of expression(rnorm( length( vStartTime ),30, 3)), representing delayed responses with a normal distribution, where the mean is 30 days and the standard deviation is 3 days.

enrollrate

probability that patients in the population can enroll in the trial. This parameter is related to the number of people who have been affected by the disease in the population, following an exponential distribution.

N1

number of participants with equal randomization in the 'initialization' period. Recommend using 10 percent of the total sample size.

armn

number of total arms in the trial.

h

a vector of success probabilities in hypotheses, for example, as c(0.1,0.1) where 0.1 stands for the success probability for both groups. Another example is c(0.1,0.3) where 0.1 and 0.3 stand for the success probabilities for the control and the treatment group, respectively.

N2

maximal sample size for the trial.

tp

tuning parameter. Some commonly used numbers are 0.5, 1 and n/2N.

armlabel

a vector of arm labels with an example of c(1, 2), where 1 and 2 describe how each arm is labeled in a two-armed trial.

blocksize

size of block used for equal randomization regarding participants in the 'initialization' period. Recommend to be an even multiple of the number of total arms.

alpha1, beta1

\alpha and \beta in the Beta(\alpha,\beta), prior for arm 1 which stands for the control. Default value is set to 1.

alpha2, beta2

\alpha and \beta in the Beta(\alpha,\beta), prior for arm 2. Default value is set to alpha1 and beta1.

alpha3, beta3

\alpha and \beta in the Beta(\alpha,\beta) prior for arm 3. Default value is set to alpha1 and beta1.

alpha4, beta4

\alpha and \beta in the Beta(\alpha,\beta) prior for arm 4. Default value is set to alpha1 and beta1..

alpha5, beta5

\alpha and \beta in the Beta(\alpha,\beta) prior for arm 5. Default value is set to alpha1 and beta1.

minstart

a specified number of participants when one starts to check decision rules.

deltaa

a vector of minimal effect expected to be observed for early futility stopping in each arm is approximately 1\%. The length of this parameter is armn-1.

tpp

indicator of tp equals to n/2N. When tp is n/2N, tpp should be assigned 1. Default value is set to 0.

deltaa1

a vector of pre-specified minimal effect size expected to be observed at the final stage for each arm. The length of this parameter is armn-1.

side

direction of a one-sided test, with values 'upper' or 'lower'.

output

control the output of brar_select_au_binary. If user does not specify anything, the function returns the entire data set used to select the stopping boundary for each iteration. If the user specifies 'B', the function only returns the selected stopping boundary for each iteration.

...

additional arguments to be passed to integrate (such as rel.tol) from this function.

Details

This function generates a data set or a value in one iteration for selecting the appropriate au using Bayesian response-adaptive randomization with a control group under null hypotheses with no delay and delayed scenarios. The function can handle trials with up to 5 arms for binary outcomes. This function uses the formula \frac{Pr(p_k=max\{p_1,...,p_K\})^{tp}} {\sum_{k=1}^{K}{Pr(p_k=max\{p_1,...,p_K\})^{tp}}} with side equals to 'upper', and \frac{Pr(p_k=min\{p_1,...,p_K\})^{tp}} {\sum_{k=1}^{K}{Pr(p_k=min\{p_1,...,p_K\}){tp}}} with side equals to 'lower', utilizing available data at each step. Considering the delay mechanism, Pats (the number of patients accrued within a certain time frame), nMax (the assumed maximum accrued number of patients with the disease in the population) and TimeToOutcome (the distribution of delayed response times or a fixed delay time for responses) are parameters in the functions adapted from https://github.com/kwathen/IntroBayesianSimulation. Refer to the website for more details.

Value

A list of results generated from formula Pr(p_k>p_{control}+\delta|data_{t-1}) at each step. Note that before final stage of the trial, test statistics is calculated from deltaa, and test statistics is calculated from deltaa1 at the final stage.

References

Wathen J, Thall P (2017). “A simulation study of outcome adaptive randomization in multi-arm clinical trials.” Clinical Trials, 14, 174077451769230. doi:10.1177/1740774517692302.

Examples

#brar_select_au_binary with delayed responses follow a normal distribution with
#a mean of 30 days and a standard deviation of 3 days, where h1=c(0.2,0.4), tp=0.5,
#early futility stopping is set at -0.085, and the minimal effect size is 0.1.
set.seed(123)
stopbound1<-lapply(1:10,function(x){brar_select_au_binary(Pats=10,
nMax=50000,TimeToOutcome=expression(rnorm( length( vStartTime ),30, 3)),
enrollrate=0.1,N1=24,armn=2,h=c(0.3,0.3),N2=224,tp=0.5,armlabel=c(1,2),
blocksize=4,alpha1=1,beta1=1,alpha2=1,beta2=1,minstart=24,deltaa=-0.01,
tpp=0,deltaa1=0.1,side='upper')})
simf<-list()
for (xx in 1:10){
    if (any(stopbound1[[xx]][24:223,2]<0.01)){
      simf[[xx]]<-NA
   }  else{
      simf[[xx]]<-stopbound1[[xx]][224,2]
 }
}
simf1<-do.call(rbind,simf)
sum(is.na(simf1))/10  #1, achieve around 10% futility
sum(simf1>0.36,na.rm=TRUE)/10  #0.1
#the selected stopping boundary is 0.36 with an overall upper one-sided type I
#error of 0.1, based on 10 simulations. It is recommended to conduct more simulations 
#(i.e., 1000) to obtain an accurate au.

[Package RARtrials version 0.0.1 Index]