Learn R Programming

RARtrials: Response Adaptive Randomization in Clinical Trials

RARtrials is designed for simulating some popular response-adaptive randomization methods in the literature with comparisons of each treatment group to a control group under no delay and delayed (time between treatment and outcome availability) scenarios. All the designs are based on one-sided tests with a choice from values of 'upper' and 'lower'. The general assumption is that binary outcomes follow Binomial distributions, while continuous outcomes follow normal distributions. Additionally, the number of patients accrued in the population follows a Poisson process and users can specify the enrollment rate of patients enrolled in the trial.

Install RARtrials from CRAN with:

install.packages('RARtrials')

Alternatively, install the RARtrials package from github with:

#install.packages('devtools')
devtools::install_github("yayayaoyaoyao/RARtrials")

Usage

There are two main groups of functions: those for simulating trials, which begin with sim_, and other functions that constitute the code for sim_ with varying names. Functions included in this R package are as follows:

  • sim_RPTW for the Randomized Play-the-Winner rule with binary outcomes in two-armed trials (Wei and Durham, 1978);

  • sim_dabcd_small_var for the doubly adaptive biased coin design targeting Neyman allocation and RSIHR allocation using minimal variance strategy with binary outcomes in trials with up to five arms (Biswas and Mandal, 2004; Atkinson and Biswas, 2013) and dabcd_small_var calculates the allocation probabilities with available data using this method;

  • sim_dabcd_max_power for the doubly adaptive biased coin design targeting Neyman allocation and RSIHR allocation using maximal power strategy with binary outcomes in trials with up to five arms and up to three arms respectively (Tymofyeyev, Rosenberger, and Hu, 2007; Jeon and Hu, 2010; Bello and Sabo, 2016) and dabcd_max_power calculates the allocation probabilities with available data using this method;

  • sim_A_optimal_known_var, sim_A_optimal_unknown_var, sim_Aa_optimal_known_var, sim_Aa_optimal_unknown_var, sim_RSIHR_optimal_known_var and sim_RSIHR_optimal_unknown_var for Neyman allocation ($A_a$-optimal allocation and $A$-optimal allocation) and generalized RSIHR allocation subject to constraints for continuous outcomes with known and unknown variances in trials with up to five arms (Sverdlov and Rosenberger, 2013; Biswas and Mandal, 2004; Atkinson and Biswas, 2013);

  • sim_brar_binary, sim_brar_known_var and sim_brar_unknown_var for Bayesian response-adaptive randomization using the Thall & Wathen method for binary outcomes, continuous outcomes with known and unknown variances in trials with up to five arms (Thall and Wathen, 2007); brar_select_au_binary, brar_select_au_known_var and brar_select_au_unknown_var can select appropriate $a_U$ using this method under null hypotheses; Functions start with pgreater_ calculate the posterior probability of stopping a treatment group due to futility around $1%$; Functions start with pmax_ calculate the posterior probability that a particular arm is the best in a trial; convert_gamma_to_chisq, convert_chisq_to_gamma and update_par_nichisq are particular set-up for continuous outcomes with unknown variances;

  • sim_flgi_binary, sim_flgi_known_var and sim_flgi_unknown_var for the forward-looking Gittins index rule and the controlled forward-looking Gittins index rule for binary outcomes and continuous outcomes with known and unknown variances in trials with up to five arms (Villar, Wason, and Bowden, 2015; Williamson and Villar, 2019); flgi_cut_off_binary, flgi_cut_off_flgi_known_var and flgi_cut_off_flgi_unknown_var can select cut-off values at the final stage for statistical inference; Gittins provides Gittins indices for binary reward processes and normal reward processes with known and unknown variance for certain discount factors.

Copy Link

Version

Install

install.packages('RARtrials')

Monthly Downloads

165

Version

0.0.2

License

GPL (>= 3)

Issues

Pull Requests

Stars

Forks

Maintainer

Chuyao Xu

Last Published

April 3rd, 2025

Functions in RARtrials (0.0.2)

pgreater_normal

Calculate the Futility Stopping Probability for Continuous Endpoint with Known Variances Using Normal Distribution
flgi_cut_off_known_var

Cut-off Value of the Forward-looking Gittins Index Rule in Continuous Endpoint with Known Variances
pgreater_beta

Calculate the Futility Stopping Probability for Binary Endpoint with Beta Distribution
flgi_cut_off_unknown_var

Cut-off Value of the Forward-looking Gittins Index rule in Continuous Endpoint with Unknown Variances
pmax_beta

Posterior Probability that a Particular Arm is the Best for Binary Endpoint
sim_A_optimal_unknown_var

Simulate a Trial Using A-Optimal Allocation for Continuous Endpoint with Unknown Variances
pmax_normal

Posterior Probability that a Particular Arm is the Best for Continuous Endpoint with Known Variances
pmax_NIX

Posterior Probability that a Particular Arm is the Best for Continuous Endpoint with Unknown Variances
sim_A_optimal_known_var

Simulate a Trial Using A-Optimal Allocation for Continuous Endpoint with Known Variances
pgreater_NIX

Calculate the Futility Stopping Probability for Continuous Endpoint with Unknown Variances Using a Normal-Inverse-Chi-Squared Distribution
sim_dabcd_min_var

Simulate a Trial Using Doubly Adaptive Biased Coin Design with Minmial Variance Strategy for Binary Endpoint
sim_brar_binary

Simulate a Trial Using Bayesian Response-Adaptive Randomization with a Control Group for Binary Outcomes
sim_RPTW

Simulate a Trial Using Randomized Play-the-Winner Rule for Binary Endpoint
sim_brar_known_var

Simulate a Trial Using Bayesian Response-Adaptive Randomization with a Control Group for Continuous Endpoint with Known Variances
sim_dabcd_max_power

Simulate a Trial Using Doubly Adaptive Biased Coin Design with Maximal Power Strategy for Binary Endpoint
sim_flgi_binary

Simulate a Trial Using Forward-Looking Gittins Index for Binary Endpoint
sim_RSIHR_optimal_unknown_var

Simulate a Trial Using Generalized RSIHR Allocation for Continuous Endpoint with Unknown Variances
sim_Aa_optimal_unknown_var

Simulate a Trial Using Aa-Optimal Allocation for Continuous Endpoint with Unknown Variances
sim_brar_unknown_var

Simulate a Trial Using Bayesian Response-Adaptive Randomization with a Control Group for Continuous Endpoint with Unknown Variances
sim_Aa_optimal_known_var

Simulate a Trial Using Aa-Optimal Allocation for Continuous Endpoint with Known Variances
sim_RSIHR_optimal_known_var

Simulate a Trial Using Generalized RSIHR Allocation for Continuous Endpoint with Known Variances
update_par_nichisq

Update Parameters of a Normal-Inverse-Chi-Squared Distribution with Available Data
sim_flgi_unknown_var

Simulate a Trial Using Forward-Looking Gittins Index for Continuous Endpoint with Unknown Variances
sim_flgi_known_var

Simulate a Trial Using Forward-Looking Gittins Index for Continuous Endpoint with Known Variances
Gittins

Gittins Indices
RARtrials-package

RARtrials: Response-Adaptive Randomization in Clinical Trials
flgi_cut_off_binary

Cut-off Value of the Forward-looking Gittins Index Rule in Binary Endpoint
brar_select_au_binary

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

Convert parameters from a Normal-Inverse-Gamma Distribution to a Normal-Inverse-Chi-Squared Distribution
convert_chisq_to_gamma

Convert parameters from a Normal-Inverse-Chi-Squared Distribution to a Normal-Inverse-Gamma Distribution
dabcd_min_var

Allocation Probabilities Using Doubly Adaptive Biased Coin Design with Minimal Variance Strategy for Binary Endpoint
brar_select_au_unknown_var

Select au in Bayesian Response-Adaptive Randomization with a Control Group for Continuous Endpoint with Unknown Variances
dabcd_max_power

Allocation Probabilities Using Doubly Adaptive Biased Coin Design with Maximal Power Strategy for Binary Endpoint
brar_select_au_known_var

Select au in Bayesian Response-Adaptive Randomization with a Control Group for Continuous Endpoint with Known Variances