Group.dyldDBCD_Bin: Group Doubly Biased Coin Design with Delayed Binary Response

View source: R/groupRAR_functions.R

Group.dyldDBCD_BinR Documentation

Group Doubly Biased Coin Design with Delayed Binary Response

Description

Simulating the group doubly biased coin design with delayed binary response (number of arms \ge 2) in a clinical trial context. (Inference: two-sided t-test for two arms or chi-square test for more than two arms.)

Usage

Group.dyldDBCD_Bin(n0 = 20, p, k, ssn, gsize.param, rspT.dist, rspT.param,
                   theta0 = NULL, target.alloc = "RPW", r = 2, nsim = 2000,
                   eTime = 7, mRate = NULL, alpha = 0.05, allocation = "DBCD",
                   erade.alpha = 0.5, lower.bound = 0, test.fun = NULL,
                   typeI = FALSE, seed = NULL)

Arguments

n0

A positive integer and a multiple of k. Whole groups are assigned by restricted randomization until at least n0 patients are enrolled, for initial parameter estimation.

p

A vector of length k with values between 0 and 1. The true success rates of the treatments, used to generate data for the simulations.

k

A positive integer. The number of treatment groups in the trial (k \ge 2).

ssn

A positive integer. The total number of participants in each simulated trial.

gsize.param

A positive number. Group sizes are drawn from a zero-truncated Poisson distribution with rate gsize.param, so every group has at least one patient.

rspT.dist

The distribution of the time from enrollment until the response is observed. One of "exponential", "normal" or "uniform".

rspT.param

A numeric vector of parameters for the response-time distributions, one distribution per treatment and response, ordered as (treatment 1 failure, treatment 1 success, treatment 2 failure, treatment 2 success, ...). For "exponential" give the 2k means. For "normal" give 2k (mean, sd) pairs and for "uniform" give 2k (min, max) pairs, that is 4k values in total. Normal times below 0 are set to 0. For example, with k = 2 and exponential times, rspT.param = c(3, 2, 4, 1) gives mean times 3 and 2 for failures and successes on treatment 1, and 4 and 1 on treatment 2.

theta0

A vector of length k used to smooth the success-rate estimates, \hat p_k = (S_k + \theta_{0k})/(N_k + 1), where S_k and N_k are the number of observed successes and observed responses on treatment k. If NULL (default), all values are 0.5.

target.alloc

Desired allocation proportion. One of "Neyman", "RSIHR", "RPW", "WeisUrn", "OptimalNeyman" or "OptimalRSIHR". The default is "RPW". See Details.

r

A non-negative number. The tuning parameter of Hu and Zhang's allocation function, used when allocation = "DBCD". Values between 2 and 4 are common. The default value is 2.

nsim

A positive integer. The number of simulated trials, with a default value of 2000.

eTime

A positive number. The time between the enrollment of consecutive groups. Allocation probabilities are updated once per group, using the responses observed by then. The default is 7.

mRate

A number between 0 and 1 giving the probability that a response is missing. Missingness is simulated completely at random (MCAR), and missing responses are excluded from estimation and testing. The default NULL means no missing responses. As in Zhai et al. (2024), missing responses are excluded from the estimates, the failure rate and the test, while the allocation proportions (both those used by the allocation function and the reported ones) count all enrolled patients.

alpha

A number between 0 and 1. The significance level of the two-sided test, with a default value of 0.05.

allocation

The allocation function. "DBCD" (default) uses the allocation function of Hu and Zhang (2004) with parameter r. "ERADE" uses the efficient randomized adaptive design of Hu, Zhang and He (2009), in its multi-arm version (Alkhnefr, Hu and Zhai, 2025), with parameter erade.alpha. See Details.

erade.alpha

A number between 0 and 1. The degree of randomization of ERADE, used when allocation = "ERADE". Smaller values push the allocation more strongly towards the target, and values of 1/2 or 2/3 are recommended. The default is 0.5.

lower.bound

A number between 0 and 1/k. The smallest allowed target proportion of each arm for the targets "OptimalNeyman" and "OptimalRSIHR". The default is 0.

test.fun

An optional function function(outcome, assignment) that returns the p-value of a test for one simulated trial, where outcome holds the observed responses and assignment the treatment labels (integers 1 to k); missing responses are removed first. The null hypothesis is rejected when the p-value is at most alpha. The default NULL uses the built-in two-sided tests: the t-test for two arms and the Wald chi-squared test of equal means for more than two arms (for binary responses, if some arms have no variability, the variances are computed from (S_k + 1)/(n_k + 2) as in Agresti and Caffo, 2000).

typeI

Logical. If TRUE, the simulation is repeated under the null hypothesis, with every arm's success rate set to the average of p, and the rejection rate is reported as type I error. The default is FALSE.

seed

An optional integer passed to set.seed before simulating, so that the results can be reproduced. The default NULL leaves the random number generator unchanged.

Details

Hu and Zhang's doubly biased coin design (DBCD) adjusts the probability of assigning each patient to a specific treatment group in a clinical trial, based on the responses of all previous patients. The group DBCD is a more practical version of this approach. It updates the allocation probabilities for the patients in each group based on the available responses of all preceding groups, either when the data become available or at fixed time intervals (for example weekly or biweekly). This function implements the group doubly biased coin design for delayed binary responses.

The process begins by assigning the first n0 patients (possibly the first few groups) to treatment groups using restricted randomization and collecting their responses. Initial parameter estimates for the response variable are then obtained for each treatment group. Based on these estimates, the estimated desired allocation proportion is calculated. Then Hu and Zhang's allocation function is applied to determine the probabilities for the next group of patients to be assigned to each treatment group, which drive the allocation proportion towards the desired one. This process is repeated sequentially for each group until the predetermined number of patients has been allocated.

This methodology was introduced by Zhai, Li, Zhang and Hu (2024) in their paper 'Group response-adaptive randomization with delayed and missing responses'.

Target allocations. With q_k = 1 - p_k, "Neyman" and "RSIHR" are proportional to \sqrt{p_k q_k} and \sqrt{p_k}. For two arms these are the Neyman allocation and the optimal allocation of Rosenberger et al. (2001), and for more arms they are simple generalizations. "RPW" and "WeisUrn" are proportional to 1/q_k, the limiting allocation of the randomized play-the-winner rule and of Wei's urn. "OptimalNeyman" and "OptimalRSIHR" are the k-arm optimal allocations of Tymofyeyev, Rosenberger and Hu (2007). They minimize the total sample size and the expected number of failures, respectively, for a fixed noncentrality parameter of the chi-squared test of equal success rates, with every proportion at least lower.bound. For two arms and lower.bound = 0 they equal "Neyman" and "RSIHR". For three or more arms the optimum without a lower bound can assign no patients to the middle arms, so a positive lower.bound such as 0.1 is recommended.

Allocation functions. With allocation = "ERADE" and \alpha = erade.alpha, arm k receives the next patient (in group designs, each patient of the next group) with probability \alpha\hat\rho_k if it is over-allocated (N_k/m > \hat\rho_k), \hat\rho_k if it is on target, and \hat\rho_k + (1-\alpha)\sum_{j \in S}\hat\rho_j/|T| if it is under-allocated, where S and T are the sets of over- and under-allocated arms, N_k/m is the current allocation proportion and \hat\rho is the estimated target (Alkhnefr, Hu and Zhai, 2025, eq. (1)). For two arms this is the ERADE of Hu, Zhang and He (2009). ERADE attains the lower bound of the asymptotic variance of the allocation proportions, so its allocation is less variable than that of the DBCD.

Value

An object of class "grouprar", a list that is printed as a short summary (see print.grouprar), with the following elements.

method

The name of the procedure.

sample size

The total sample size (Total) and the expected number of patients with observed responses (Effective Size).

parameter

The true success rates used in the simulations, named pA, pB, ...

propotion

The mean allocation proportion of each arm over the simulations, named treatment A, treatment B, ...

sd of propotion

The standard deviation of the allocation proportion of each arm over the simulations.

failure rate

The mean failure rate over the simulations.

sd of failure rate

The standard deviation of the failure rate (or mean response) over the simulations.

power

The proportion of simulated trials that reject the null hypothesis of equal success rates. Simulations in which the test cannot be computed are dropped.

data: failureRate

The failure rate (or mean response) of each simulated trial.

data: test

The test decision of each simulated trial (1 = reject).

data: assignment

The treatment assignments of the last simulated trial.

data: propotion

A data frame with the allocation proportions of each simulated trial.

data: allocation

An nsim by ssn matrix with the treatment assignments of every simulated trial.

type I error

Only if typeI = TRUE. The rejection rate under the null hypothesis.

duration

The mean time from the first enrollment to the last observed response. Trials without any observed response have duration NA and are left out of the mean.

sd of duration

The standard deviation of the duration over the simulations.

enrollment duration

The mean time from the first to the last enrollment.

data: duration

The duration of each simulated trial.

data: enrollment

The enrollment duration of each simulated trial.

References

Alkhnefr, N., Hu, F. and Zhai, G. (2025). Efficient randomized adaptive designs for multi-arm clinical trials. Statistical Methods in Medical Research, 34(9), 1886-1898. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1177/09622802251362644")}

Hu, F. and Zhang, L. X. (2004). Asymptotic properties of doubly adaptive biased coin designs for multitreatment clinical trials. The Annals of Statistics, 32(1), 268-301. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1214/aos/1079120137")}

Hu, F., Zhang, L. X. and He, X. (2009). Efficient randomized-adaptive designs. The Annals of Statistics, 37(5A), 2543-2560. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1214/08-AOS655")}

Rosenberger, W. F., Stallard, N., Ivanova, A., Harper, C. N. and Ricks, M. L. (2001). Optimal adaptive designs for binary response trials. Biometrics, 57(3), 909-913. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1111/j.0006-341X.2001.00909.x")}

Tymofyeyev, Y., Rosenberger, W. F. and Hu, F. (2007). Implementing optimal allocation in sequential binary response experiments. Journal of the American Statistical Association, 102(477), 224-234. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1198/016214506000000906")}

Zhai, G., Li, Y., Zhang, L. and Hu, F. (2024). Group response-adaptive randomization with delayed and missing responses. Statistics in Medicine, 43(27), 5047-5059. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1002/sim.10220")}

Examples

# a simple use
## Arguments for generating the simulated data
### For response simulation
p = c(0.7, 0.5)
k = 2
ssn = 200

### for entry time and response time simulation
eTime = 7
rspT.param = rep(10, 4)
rspT.dist = "exponential"
gsize.param = 5

## Arguments for the design
n0 = 10
target.alloc = "RPW"

res <- Group.dyldDBCD_Bin(n0 = n0, p = p, k = k, ssn = ssn, gsize.param = gsize.param,
                          rspT.dist = rspT.dist, rspT.param = rspT.param, theta0 = NULL,
                          target.alloc = target.alloc, r = 2,
                          nsim = 100, eTime = eTime, mRate = NULL, alpha = 0.05)

# View the output (a list of all results)
res

## three arms, ERADE and the optimal RSIHR target, with the trial duration
res3 <- Group.dyldDBCD_Bin(n0 = 21, p = c(0.6, 0.7, 0.8), k = 3, ssn = 120,
                           gsize.param = 5, rspT.dist = "exponential",
                           rspT.param = rep(5, 6), target.alloc = "OptimalRSIHR",
                           lower.bound = 0.1, nsim = 30, allocation = "ERADE", seed = 1)
res3[["duration"]]

grouprar documentation built on Oct. 9, 2026, 9:07 a.m.