RARtool : A MATLAB Software Package for Designing Response-Adaptive Randomized Clinical Trials with Time-to-Event Outcomes

Response-adaptive randomization designs are becoming increasingly popular in clinical trial practice. In this paper, we present RARtool , a user interface software developed in MATLAB for designing response-adaptive randomized comparative clinical trials with censored time-to-event outcomes. The RARtool software can compute diﬀerent types of optimal treatment allocation designs, and it can simulate response-adaptive randomization procedures targeting selected optimal allocations. Through simulations, an investigator can assess design characteristics under a variety of experimental scenarios and select the best procedure for practical implementation. We illustrate the utility of our RARtool software by redesigning a survival trial from the literature.


Introduction
Response-adaptive randomization (RAR) in clinical trials refers to sequential modification of treatment randomization probabilities based on the history of treatment assignments and responses from patients in the trial, with the goal of assigning more patients to the better treatment while maintaining important statistical properties of the trial design . Modern research on RAR has focused on the development of optimal RAR procedures for multi-objective clinical trials with two or more treatment arms using a template of Hu and Rosenberger (2003). The idea is to determine an optimal allocation for the given experimental objectives  and find a fully randomized RAR procedure with minimal variability that converges to the chosen optimal allocation (Hu, Rosenberger, and Zhang 2006). Although optimal RAR designs frequently have more desirable statistical properties than traditional fixed randomization designs, implementation of the former designs in clinical trials has been limited. One of the reasons is lack of user-friendly statistical software which would allow an experimenter to visualize design characteristics under a variety of hypothetical experimental scenarios and select an optimal procedure for use in practice.
In this paper, we present RARtool, a user-friendly software package, developed in MAT-LAB (The MathWorks, Inc. 2011), to facilitate the design of randomized comparative clinical trials with time-to-event outcomes, by implementing statistical methodology from several recent papers (Zhang and Rosenberger 2007;Sverdlov, Tymofyeyev, and Wong 2011;Wong 2012, 2014). The highlights of RARtool are as follows.
(1) It can compute optimal allocation designs and values of different statistical efficiency criteria for user-selected sets of experimental parameters. Such optimal allocations provide "benchmarks" for comparison of various allocation designs. (2) It can perform Monte Carlo simulations of RAR procedures targeting selected optimal allocations. Through simulations, an investigator can assess the performance of RAR procedures under a variety of standard to worst-case scenarios and select the best procedure for practical implementation. Therefore, the RARtool package is intended to fill the gap between methodology and implementation of optimal RAR designs in time-to-event trials.
The outline of the paper is as follows. Section 2 gives statistical background material. In Section 3, we describe the structure of the RARtool package, and in Section 4, we illustrate its utility by redesigning a survival trial from the literature. In Section 5, we give a summary and discuss possible extensions. Hu and Rosenberger (2003) proposed a mathematical template for developing optimal RAR procedures. Their template consists of three major steps:

Statistical background
1. Deriving an optimal allocation to satisfy selected experimental objectives. The objectives may include most accurate estimation of treatment contrasts, maximizing power of a statistical test, or minimizing total hazard in the study subject to appropriate constraints.
2. Constructing a RAR procedure with minimal variability and high speed of convergence to the chosen optimal allocation.
3. Analyzing clinical trial data following the chosen RAR procedure.
Our software development process follows this template for clinical trials with censored timeto-event outcomes.

Optimal allocation
Consider a clinical trial with K ≥ 2 treatment arms and time-to-event primary outcomes. We assume a parallel group design with n subjects (n is fixed and pre-determined by budgetary and logistical considerations) for which n k subjects are to be assigned to treatment k, where k = 1, . . . , K and K k=1 n k = n. Many survival trials in the literature use designs with K = 2 or K = 3 treatment arms.
Throughout the paper we assume that event times follow a parametric distribution with probability density function f (t|θ) and survivor function S(t|θ) = ∞ t f (s|θ)ds, where θ is a vector of unknown model parameters. In time-to-event trials observations are likely to be right-censored by some fixed or random censoring time (Lawless 2003). For the ith patient in group k, let T ik denote the event time, C ik denote the censoring time, t ik = min(T ik , C ik ) denote the actual observed time, and δ ik = 1 {t ik =T ik } denote the event indicator (δ ik = 1, if T ik ≤ C ik and δ ik = 0 otherwise). The individual observations (t ik , δ ik ) are assumed to be independent for i = 1, . . . , n k and k = 1, . . . , K. The likelihood function is given by The maximum likelihood estimator can be determined by solving the system of score equations ∂ ∂θ log L(Data|θ) = 0, and it is important to note that E{ ∂ ∂θ log L(Data|θ)} = 0. The key object in optimal design theory is the Fisher information matrix given by M (θ) = −E ∂ 2 ∂θ∂θ log L(Data|θ) , whose inverse provides the lower bound on the variance of an unbiased estimator of θ. By minimizing the inverse of the Fisher information matrix by choice of design one can achieve the most accurate inference for the parameters of interest.
In this paper we consider two different parametric model for event times and different optimization problems.

Exponential model
The exponential distribution is frequently used in survival analysis because it represents a natural starting point for development of optimal allocation designs for time-to-event trials (Lawless 2003).
For the ith patient in group k we assume that the patient's event time T ik follows an exponential distribution with mean θ k , k = 1, . . . , K. Then f (t ik |θ) = θ −1 k exp(−t ik /θ k ), S(t ik |θ) = exp(−t ik /θ k ), and θ = (θ 1 , . . . , θ K ) . The likelihood function is where ∆ k = n k i=1 δ ik is the number of events in group k and T k = n k i=1 t ik is the total observed time for group k. The maximum likelihood estimator of θ k isθ k = T k /∆ k . Define k = P(T ik ≤ C ik ), the probability of observing the event before censoring in group k. The expression for k depends on the censoring mechanism used in the trial; in general k is a function of θ. Let ρ = (ρ 1 , . . . , ρ K ) denote the design that allocates the proportion ρ k of the total subjects to treatment group k, with the conditions 0 ≤ ρ k ≤ 1 and K k=1 ρ k = 1. For a trial with n patients, this means roughly n k = nρ k are assigned to treatment k subject to K k=1 n k = n. Then the Fisher information matrix for θ using design ρ is the diagonal matrix An experimental design problem is to find an optimal allocation vector ρ * = (ρ * 1 , . . . , ρ * K ) as a solution to some formal optimization problem involving the inverse of (2). We will consider four different optimal allocation rules that address different study objectives.
Suppose the primary objective of the study concerns efficient estimation of the contrasts of (K − 1) experimental treatments 2, . . . , K versus the control treatment 1.
and we want to minimize it, in some sense, to achieve most accurate inference for A θ.
(Exp-D A ) The D A -optimal allocation minimizes the criterion log(det{A M −1 (ρ, θ)A}) (Atkinson 1982). Such an allocation results in the smallest volume of the confidence ellipsoid for A θ. The analytical description of the D A -optimal allocation is given in Sverdlov et al. (2011Sverdlov et al. ( , p. 2893. (Exp-NP2) Nonlinear Programming 2 (NP-2) allocation solving (4) with w = (θ −1 1 , . . . , θ −1 K ) . Such an allocation minimizes total expected hazard in the study subject to the minimum constraints on the treatment proportions and power. The analytical solution is unknown, but a numerical solution can be found using standard optimization software.

Weibull model
The Weibull distribution is a flexible and useful model in parametric survival analysis which allows for different hazard shapes (Carroll 2003;Cheung, Lurdes, Wathen, and Thall 2006). We shall consider several optimal allocation designs for Weibull time-to-event outcomes.
As in Sverdlov et al. (2014), let T ik > 0 denote the event time for the ith patient in group k.
For a log-transformed T ik we assume the following linear model: where W ik are independent, identically distributed errors with probability density f (w) = e w exp (−e w ). In (6), µ k represents the effect of treatment k, b is the scale parameter assumed to be common to the K groups and θ = (µ 1 , . . . , µ K , b) is the vector of unknown parameters. Note that when b = 1, we have an exponential model; otherwise we have a Weibull model which allows for different hazard patterns. Let z ik = (log t ik − µ k )/b be standardized logtransformed observed times. The likelihood function for θ is The maximum likelihood estimatorθ is found numerically from the (K + 1)-system of score equations ∂ ∂θ log L(Data|θ) = 0. The Fisher information matrix for θ is where x = (ρ 1 a 1 , . . . , ρ K a K ) , k = P(δ ik = 1), a k = E (z ik e z ik ), c k = E z 2 ik e z ik , and each of the k , a k and c k is a function of θ and the censoring mechanism used in the trial. Our goal is to find a vector of treatment allocation proportions which minimizes some convex criterion of the inverse of (8).
If α = 0, then the optimal allocation places all patients to the treatment group with maximum value of d k (or assigns equal proportions if there are several such treatments). For 0 < α ≤ 1, the optimization problem (9) has the unique solution which can be found from the system of K nonlinear equations (Weib-WDO) Weighted distance optimal allocation provides trade-off between D-optimality and some ethical criterion (Sverdlov et al. 2014). Let ρ D = (ρ D1 , . . . , ρ DK ) denote the D-optimal allocation vector and ρ E = (ρ E1 , . . . , ρ EK ) denote an allocation vector that is desirable from an ethical point of view. For instance, if shorter event times signify clinical efficacy (e.g., recovery), then an investigator may want to choose the components of ρ E as follows: where ν ≥ 0 is a user-specified parameter controlling the degree of skewness to the better treatment. With allocation (10), the condition µ i ≤ µ j implies ρ Ei ≥ ρ Ej , with equality if and only if µ i = µ j . A similar idea can be applied for trials where longer event times are clinically desirable (e.g., survival trials).
To provide trade-off between ρ D and ρ E , one can consider minimizing a weighted distance αλ(ρ, ρ D ) + (1 − α)λ(ρ, ρ E ), where λ(·, ·) is some distance measure between two vectors of allocation proportions and 0 ≤ α ≤ 1 is a user-selected constant which determines the trade-off between the inferential and ethical criteria (if α = 1, the optimal solution is ρ D ; if α = 0, the optimal solution is ρ E ; and if 0 < α < 1, then we have an allocation that provides a trade-off between efficiency and ethics).
The choice of λ KL (ρ,ρ) = K k=1 ρ k log(ρ k /ρ k ) (Kullback-Leibler directed divergence) yields the optimal solution as a weighted geometric mean of the components of ρ D and ρ E : If we select a quadratic distance metric λ 2 (ρ,ρ) = K k=1 (ρ k −ρ k ) 2 , the optimal solution is an arithmetic mean of the components of ρ D and ρ E : When we have K = 2 treatment groups, we can explicitly obtain some useful allocations for model (6); (see Zhang and Rosenberger 2007;Sverdlov et al. 2012): (Weib-D A ) D A -optimal allocation for most accurate estimation of the treatment contrast µ 2 − µ 1 , which minimizes with respect to ρ 1 ∈ (0, 1). The point of the minimum can be found numerically once we have nominal values of k , a k and d k , k = 1, 2.
(Weib-HR) Hazard ratio-optimal allocation for most accurate estimation of the log-hazard ratio (µ 2 − µ 1 )/b, which minimizes with respect to ρ 1 ∈ (0, 1). The point of the minimum can be found numerically once we have nominal values of b, k , a k , d k and µ k , k = 1, 2.
(Weib-ZR1) The allocation minimizing the average hazard of a Weibull distribution subject to the restriction on the non-centrality parameter of the Wald test; see Formula 14 on page 162 in Zhang and Rosenberger (2007).
(Weib-ZR2) The allocation minimizing the average hazard of a Weibull distribution assuming the common constant follow-up time for the patients subject to the restriction on the non-centrality parameter of the Wald test; see Formula 15 on page 163 in Zhang and Rosenberger (2007).

Response-adaptive randomization
The optimal allocation designs discussed in Section 2.1 depend on model parameters θ which are unknown at the trial onset. For implementing optimal allocation in practice, one can sequentially estimate θ using accumulating outcome data from patients in the trial and use RAR for treatment allocation. The RAR procedure should have minimal variability and high speed of convergence to the chosen optimal allocation (Hu and Rosenberger 2003).
In time-to-event trials, there is a natural delay in observing responses. The delay time for a patient is the patient's time-to-event outcome (minimum between the event time and the censoring time). A RAR procedure should account for such delays. In general, RAR is appropriate only when responses are "not significantly delayed" in the accrual pattern; e.g., when 60% or more of study subjects contribute outcome data throughout the recruitment period (Hu, Zhang, Cheung, and Chan 2008). In particular, for uniform or exponential patient accrual patterns and censored exponential or Weibull time-to-event outcomes, the asymptotic properties of certain RAR procedures are still valid (Zhang and Rosenberger 2007).
Figure 1 is a schematic illustration of a RAR procedure. Suppose the trial objectives have been quantified and the optimal target allocation is chosen as ρ = (ρ 1 (θ), . . . , ρ K (θ)) . At the beginning of the trial there are no data; therefore initial treatment allocations must be non-adaptive. The first Km 0 patients (where m 0 is some small positive integer) are randomized among treatments 1, . . . , K with equal probability. The constant m 0 is user-defined; it should be sufficiently large so that maximum likelihood estimators are attainable. In practice, simulations can be used to elicit the value of m 0 . Consider the point in the trial when i − 1 (≥ Km 0 ) patients have been randomized among K treatment groups and suppose patient i enrolls into the trial. Letθ i−1 denote the maximum likelihood estimator of θ and ρ i−1 = (ρ 1 (θ i−1 ), . . . , ρ K (θ i−1 )) denote the estimated target allocation based on the treatment assignments and responses from i − 1 patients in the trial. Then the ith patient is randomized among the treatment groups with probabilities where Ψ k (·) are some appropriately chosen functions satisfying 0 ≤ Ψ k (·) ≤ 1 and K k=1 Ψ k = 1. The choice of Ψ = (Ψ 1 (·), . . . , Ψ K (·)) is essential to ensure convergence to the target allocation. There are two types of optimal RAR procedures with established statistical properties that can be used for this purpose: the doubly-adaptive biased coin design (DBCD; Hu and Zhang 2004) and optimal RAR designs based on urn models (Zhang, Hu, Cheung, and Chan 2011). In our software development we implement the former approach.
) denote the treatment allocation proportions after i − 1 patient assignments. Then the DBCD treatment randomization probabilities for the ith patient are as follows: where γ is a user-specified parameter controlling the degree of randomness of the procedure. Hu and Zhang (2004) showed that under widely satisfied conditions (ρ(θ) must be a continuously differentiable vector function and twice continuously-differentiable in a small neighborhood of the true value of θ), the procedure (13) works as intended: the allocation proportion vector N i /i converges almost surely (as i → ∞) to ρ and has an asymptotically normal distribution. Hu et al. (2008) further showed that these large-sample properties are unaffected by delayed response under the condition that the outcomes occur "not too far out" in the accrual pattern. A "rule of thumb" is that 60% or more of the study patients should have their outcomes throughout the accrual period.
We make some further important remarks here. First, at the point of entry of the ith patient, some of the previous i − 1 patients may not have responded yet, and thereforeθ i−1 will be potentially computed based on data from fewer than i − 1 patients. Second, since estimation of θ frequently involves numerical optimization of the log-likelihood function, the algorithm may not converge andθ i−1 may not be attainable. Should this happen, the treatment assignment of the ith patient will be made with equal probability. Third, an investigator must decide how frequently treatment randomization probabilities will be updated throughout the course of the trial. One possibility is a fully sequential procedure, for which the RAR algorithm in Figure 1 is applied for every patient entering the trial. This approach utilizes all available data in the design; however, it requires that data are unblinded throughout the study, which may compromise the integrity of the trial results. Another possibility is a two-stage design: at the first stage, Km 0 patients are randomized equally among K treatments, and based on Randomize initial Km 0 patients to treatments 1,…,K with equal probability Patient i (i> Km 0 ) enters the trial Retrieve available data from previous (i-1) patients. Is there at least 1 event in each treatment group?
 Estimate the target allocation vector:  their data randomization probabilities are adjusted for the patients at the second stage. We pursue a multi-stage design by requiring that the RAR algorithm in Figure 1 is applied after every m, 2m, 3m, . . . patients, where m is some positive integer. This approach includes both a fully sequential procedure (if m = 1) and a two-stage design (if m = n/2) as special cases.

Data analysis following response-adaptive randomization
While RAR generates complex data structures as treatment assignments are no longer independent, the asymptotic properties of estimators and tests are valid under widely satisfied conditions . The DBCD procedure (13) has the following important asymptotic properties: The maximum likelihood estimatorθ n is strongly consistent for θ and follows an asymptotically normal distribution.
The vector of treatment allocation proportions N n /n is strongly consistent for ρ and has an asymptotically normal distribution with variance-covariance matrix where Σ 1 = diag{ρ 1 (θ), . . . , ρ K (θ)} − ρρ and Σ LB is the lower bound on the variance of a RAR procedure targeting ρ. The expression for Σ LB depends on the gradient of ρ(θ) and it can be found using the methodology of Hu and Zhang (2004). Note that as γ → ∞, we have Σ = Σ LB , that is, the DBCD procedure is asymptotically best for ρ ), but such a procedure is almost deterministic. In our development we use γ = 2, as suggested by Rosenberger and Hu (2004).
Since the DBCD procedure has established asymptotic properties, one can perform statistical inference for θ using standard asymptotic techniques. For instance, treatment contrasts can be tested using the Wald test and asymptotic confidence intervals for different subsets of θ can be constructed using normal approximations. It is important, however, to investigate accuracy of large-sample approximations for small and moderate sample sizes via simulation.

The RARtool package
The RARtool package has been developed in MATLAB. Our main motivation for using MAT-LAB as a basis for software development is that MATLAB has an excellent software optimization toolbox which is well-suited for fast and accurate implementation of numerical methods that are invoked repeatedly in RAR algorithms. MATLAB also has an easy-to-use tool to compile a GUI interface and create stand-alone executable files and display results in an appealing way.
There are two ways to run the RARtool package. The first way is to launch the application directly from MATLAB. The second way is to create a stand-alone executable file from MATLAB and launch this executable file. In both cases, it is assumed that the MATLAB Compiler Runtime (MCR) version 7.16 or higher is installed; if it is not, the user should run MCR Installer, e.g., located in <matlabroot>\toolbox\compiler\deploy\win32\MCRInstaller.exe on Windows. For more information about MCR, see http://www.mathworks.com/products/ compiler/mcr/. Before running RARtool, a user should copy the RARtool project files into some folder that must be added to the MATLAB path (File->Set Path in the main MATLAB window). The project files are as follows: 1.allocExponential.m -calculates optimal allocation designs for different optimality criteria in trials with exponential event times.
2.allocWeibull.m -calculates optimal allocation designs for different optimality criteria in trials with Weibull event times.
3.effExponential.m -calculates efficiency of an allocation design in trials with exponential event times.
4.effWeibull.m -calculates efficiency of an allocation design in trials with Weibull event times.
5.mle.m -calculates maximum likelihood estimates of θ for exponential and Weibull event times.
6.powerExponential.m -calculates power of an allocation design in trials with exponential event times.
7.powerWeibull.m -calculates power of an allocation design in trials with Weibull event times.
9.rartool.m -provides the GUI to get theoretical and simulated characteristics of the trial.
To run RARtool directly from MATLAB, one should type the command rartool in the MATLAB Command Window and press ENTER. The GUI window will open.
To create a stand-alone executable file, one should type the command mcc -m rartool in the MATLAB Command Window and press ENTER. The executable file rartool.exe will be created in the main MATLAB folder for Windows. After one launches rartool.exe, the GUI window will open. The following subsections give a detailed description of the GUI components of RARtool. (i) Time-to-event distribution (exponential or Weibull).

Configuration of clinical trial parameters
(ii) Number of treatment arms (K = 2 or K = 3).
Once the choices in (i) and (ii) are made, the following options become available: (iii) Specify the vector of underlying model parameters θ.
(1) Time-to-event distribution (exponential or Weibull) (2) Number of treatment arms (K=2 or K=3)  (iv) Allocation design (see Section 2.1). Note that a user can check/uncheck boxes to include/exclude a particular allocation design from the comparison.
For an exponential model with K = 2 or K = 3 treatments, five allocation designs are available: For a Weibull model with K = 2 treatments, six allocation designs are available: -D-optimal (allocation (Weib-CO) with α = 1).
(v) Censoring scheme: with constant follow-up time (each patient in the study is followed-up for a fixed time period τ > 0. The observed time is t ik = min(T ik , τ )).
combination of uniform and administrative censoring (A trial has a fixed recruitment period R > 0 and a fixed duration D > R. Patient arrival times follow a Poisson process over (0, R). The observed time is t ik = min(T ik , C ik , D − R), where C ik is the ith patient's censoring time, assumed to be uniform over (0, D)).
The reason why we focused on the two aforementioned censoring schemes in the current version of RARtool is that these schemes are quite common in practice, and they serve as useful starting points to construct optimal designs for time-to-event trials. In particular, for a censoring scheme combining uniform and administrative censoring, the censoring probabilities can be derived in closed form in the exponential response case (Zhang and Rosenberger 2007); this substantially simplifies calculation of optimal allocation designs and simplifies the development of corresponding optimal RAR designs. Our software can potentially be extended to incorporate more complex censoring schemes, such as when both accrual and censoring time distributions are not uniformly distributed. Sverdlov, Rosenberger, and Ryeznik (2013) considered such a situation, where one of the goals was to evaluate robustness of the designs to misspecification of the recruitment pattern. Implementing these additional, more complex accrual patterns and censoring schemes is one important possible extension of the RARtool package which we intend to pursue in subsequent versions of our software.

Operating characteristics of optimal allocation designs
Once the clinical trial parameters have been configured, the operating characteristics of various optimal allocation designs can be computed and visualized graphically. A user has the following options (see Figure 2): Get Allocation -The values of allocation proportions and corresponding statistical efficiency criteria for the selected designs are calculated and displayed in a tabular format. Treatment 1 is the control group, and Treatments 2 and 3 are experimental groups. For a given allocation, statistical efficiency criteria (which take values from 0 to 1, and higher values are desirable) include: D-eff (D-efficiency for estimating the vector of model parameters θ).

DA-eff (D A -efficiency for estimating the vector of treatment contrasts (experimental vs. control).
HR-eff (Efficiency for estimating the vector of hazard ratios (experimental vs. control), for the Weibull distribution with K = 2 groups).
b-eff (Efficiency for estimating the Weibull hazard pattern via the parameter b).
Power (Statistical power of the Wald test of homogeneity of treatment effects).
Get Plots -The plots of optimal allocation proportions and design efficiency criteria are generated for selected optimal allocation designs and the chosen parameter values. To assess changes in allocation and design efficiency criteria, the range of values is taken for the parameter of Treatment 1, whereas the values of other parameters (as defined by the user) are kept fixed.

Simulation of a response-adaptive randomization trial
In RARtool we have implemented the DBCD randomization procedure (13) with γ = 2.
To evaluate performance of a RAR design over multiple simulation runs, one should first configure the clinical trial parameters as described in Section 3.1. After that, one should click the Make Simulations button in the first level menu of RARtool.
To illustrate the utility of the simulation tool, we reproduce the results from Zhang and Rosenberger (2007) who used the DBCD procedure with Weibull time-to-event outcomes to redesign a phase III survival trial in metastatic breast cancer originally reported by Jones et al. (2005). In this trial, n = 449 patients were randomized equally between two treatment regimens, docetaxel (Treatment 1) and paclitaxel (Treatment 2). In the intent-to-treat population, median time to progression was significantly longer for patients treated with docetaxel (5.7 months) than with paclitaxel (3.6 months). As in Zhang and Rosenberger (2007), we assume the sample size n = 449, µ 1 = 1.1, µ 2 = 0.64, b = 0.93, the length of the recruitment period R = 84 months, and the overall study duration D = 102 months. In the first level menu of RARtool ( Figure 2) we configure the trial parameters as follows: (i) Time-to-Event = Weibull; (ii) Number of treatments = 2; (iii) Response distribution options are: mu1 = 1.1, mu2 = 0.64, b = 0.93; (iv) Design = Zhang-Rosenberger-1; (v) Censoring scheme is combination of uniform and administrative censoring with Recruitment = 84 and Duration = 102.
The second level GUI menu will open (Figure 3). The additional parameters must be specified at this point: Number of patients involved in the trial (selected is 449).
Number of patients randomized with CRD (selected is 20). This determines the initial number of patients randomized with equal probability between two treatments.  Number of patients in a cohort (selected is 20). This determines how frequently randomization probabilities are updated based on accrued data in the trial. In our example, randomization probabilities are updated after every 20 patients.
With delayed responses? (Yes/No) (Selected is Yes). If No, then simulations will be performed under an "idealized" scenario assuming that responses become available immediately after the treatment assignment. The No option may be useful for assessing theoretical properties of RAR procedures.

Number of simulations (selected is 1000).
After all these selections have been made, we click on the Simulate button, after which the progress status bar will appear. The generated results will be output in tabular and graphical formats (as shown in Figure 3).
In the tabular format (left-hand part of the display), one can see theoretical and simulated (average with standard deviation) values of target allocation proportions and model parameters, simulated (average with standard deviation) total time observed in the study (TT), simulated median values of various design efficiency criteria, and the average proportion of "responders", i.e., subjects in the study whose response data become available throughout the recruitment phase to enable adaptations in the design (prop). The simulation results show that the allocation proportion (S.D.) for Treatment 1 is 0.556 (0.017). This matches well the the results reported in Zhang and Rosenberger (2007).
In the right-hand part of the display are the plots of treatment randomization probabilities (averaged across simulation runs) at the points in the trial when the response-adaptive algorithm is applied to modify randomization probabilities. One can see that allocation becomes skewed in favor of Treatment 1 as the trial progresses. Also displayed is the plot of the simulated distribution of the maximum likelihood estimators of model parameters. In theory, model parameter estimators are consistent and have asymptotically normal distributions; however, due to delayed responses the simulated results may deviate from the theoretical ones. Therefore, it may be useful to perform simulations with the No option for delayed responses to obtain the design characteristics in the "idealized" no-delay case. In our example, the distributions look approximately normal around the "true" assumed values of the parameters.

An application
In this section we illustrate how to use the RARtool software to redesign a phase III survival trial for greater efficiency and ethical measures. We consider a phase III survival trial in patients with unresectable squamous cell head and neck cancer reported by Adelstein et al. (2003). Between March 1992 and December 1999, 295 eligible patients were randomized equally among three treatment arms: Radiotherapy Alone (Treatment 1), Radiotherapy plus Cisplatin (Treatment 2), and Radiotherapy (Split Course) plus Cisplatin/5FU (Treatment 3). The original study goal was 462 patients; however, because of a slow accrual rate, the study was closed in December 1999, after 295 patients had been enrolled. The data were analyzed as of January 2001. The primary endpoint was overall survival defined as the time from randomization to death from any cause. The median survival times were 12.6, 19.1, and 13.8 months, for Treatments 1, 2, and 3, respectively. The study recruitment duration was R = 94 months and the overall study duration was D = 106 months. To gain insights of various possible allocation designs for this study, we examine both exponential and Weibull time-toevent distributions. In both cases, we assume a combination of uniform and administrative censoring scheme.

Exponential event times
For an exponential distribution, Mean = Median/log(2). Under this assumption, based on data in Adelstein et al. (2003) we elicit that the mean survival times in the three treatment groups are 18.2, 27.6, and 19.9 months. In the first level menu of RARtool we configure the trial parameters as follows: (1 The most skewed is the NP-1 with B = 0.1 design which should assign 58% of study patients to the most efficacious Treatment 2, 32% of study patients to the "control" Treatment 1, and 10% of study patients to Treatment 3. Let us consider D A -efficiency as a measure of goodness of the designs. From RARtool, the values of D A -efficiency for the D-A-optimal, A-A-optimal, NP-1 with B = 0.1, and balanced designs are 1, 0.97, 0.58, and 0.98, respectively. Next, we click on the Make Simulations button in RARtool. In addition to the already specified parameters, we specify that Number of patients involved in the trial = 295, Number of patients randomized with CRD = 30, Number of patients in cohort = 30, and Number of simulations = 5000. We perform seven sets of simulations consecutively for the four designs (D-A-optimal, A-A-optimal, NP-1 with B = 0.1, and balanced). For the first three designs, we explore both the cases of "without delay" and "with delay" (options No and Yes, respectively, in the With delayed responses field). For the balanced randomization design, which is non-adaptive, only the No option is used. Table 1 summarizes the key operating characteristics of the four randomization designs. For each of the three response-adaptive designs, there is overall a good agreement between the operating characteristics (average allocation proportions and median values of D A -efficiency) in the simulations "without delay" and the corresponding theoretical values. Some discrepancy is present for the "most skewed" NP-1 with B = 0.1 design. In the simulations "with delay", while the adaptive designs are skewed towards their intended targets, the convergence is not fully achieved due to delayed responses. It is worth noting that the D-A-optimal design is advantageous over the balanced design both in terms of D A -efficiency and the total survival time, both in the "without delay" and the "with delay" cases.

Weibull event times
For the Weibull model (6), the median of the event time in group k is e µ k (log 2) 1/b . To match the median survival times reported in Adelstein et al. (2003) and to be consistent with the setting in Section 4.1, we assume b = 1 (exponential distribution) and elicit µ 1 = 2.90, µ 2 = 3.32, µ 1 = 2.99. We want to compare the merits of three allocation designs developed under the Weibull model. These designs are: D-Optimal -D-optimal allocation (Equation 12 with α = 1); WO-Euclid with alpha = 0.5 -Weighted distance optimal allocation that provides equal trade-off between D-efficiency and ethics (Equation 12 with α = 0.5); Ethical -Ethical allocation (Equation 12 with α = 0).
As in the exponential case (Section 4.1), in the first level menu we configure the trial pa-   Adelstein et al. (2003) using RARtool, assuming exponential outcomes, based on 5, 000 simulation runs.  Table 2 summarizes the key results. The D-Optimal design is almost identical to the balanced completely randomized design. It is highly efficient, but does not allocate patients to better performing treatment arms. Designs WO-Euclid with alpha = 0.5 and Ethical result in skewed allocations in favor of treatments with longer event times. The Ethical design is most skewed and has highest average total survival time; yet it is also most variable and least efficient among the three designs. The WO-Euclid with alpha = 0.5 design achieves a reasonable trade-off between inferential efficiency (D A -efficiency = 0.98) and ethics (total survival time). Note that because of delayed responses the intended skewing is not achieved for the latter two designs. This is consistent with the findings in the exponential case (Section 4.1).

Some further remarks
The examples considered in this paper are phase III trials. One may argue that the regulatory agencies give very limited flexibility to adaptive phase III confirmatory trials, in particular   Adelstein et al. (2003) using RARtool, assuming Weibull outcomes, based on 5, 000 simulation runs. trials with response-adaptive randomization (US Food and Drug Administration 2010). The main reasons we considered phase III trials in this paper are three-fold. First, we wanted to illustrate that our software can successfully validate simulation results previously reported in the literature -the example in Section 3.3 shows that RARtool accurately replicates the results from Zhang and Rosenberger (2007). Second, the examples from Sections 4.1 and 4.2 show that RAR can be an attractive strategy for phase III survival trials which exhibit significant differences among the treatment arms -in this case the allocation is skewed to treatment arms with longer survival times. Third, and most important, we believe that the examples presented here add to the body of knowledge on how RAR works in phase III survival trials; we hope that this work along with others will eventually pave the way for implementation of RAR trials in practice.
We would also like to mention that our software can simulate design operating characteristics for any user-specified sample size. As such the software can potentially handle designs of randomized phase II time-to-event trials with small or moderate sample sizes. While RAR methodology relies on large sample approximations, simulations show that moderate sample sizes (n = 50 to 100) are sufficient for the large sample approximations to be reasonably valid if the doubly-adaptive biased coin design of Hu and Zhang (2004), implemented in the current paper, is used; see Rosenberger, Sverdlov, and Hu (2012, p. 728) for further details.

Conclusions and future work
In this paper, we have presented a user-friendly software RARtool which should aid an investigator in planning response-adaptive randomized comparative clinical trials with censored time-to-event outcomes. Our software implements various optimal allocation schemes (Zhang and Rosenberger 2007;Sverdlov et al. 2011Sverdlov et al. , 2012Sverdlov et al. , 2014, under the assumptions of exponential and Weibull distribution for the event times. The implemented randomization designs are scientifically sound and can provide trade-off between statistical efficiency and ethical considerations. While the current version of RARtool can be useful in designing randomized time-to-event clinical trials, it can be improved in a number of ways. We outline a few possible extensions: Explore additional design optimality criteria and additional censoring schemes. Implement optimal allocation designs and corresponding RAR procedures in a (K > 3)treatment case. Implement urn-based optimal RAR procedures (Zhang et al. 2011) and compare them with the the DBCD procedure (Hu and Zhang 2004) implemented in this paper.
Incorporate group-sequential monitoring schemes on top of RAR to allow early stopping of a trial for efficacy or futility.
Develop a utility that allows interactive sequential data entry to recalculate treatment randomization probabilities and facilitate implementation of RAR designs in practice.
We intend to tackle the above mentioned problems in our future work.