View source: R/groupRAR_functions.R
| DBCD_Bin | R Documentation |
Simulating Hu and Zhang's doubly biased coin design with 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.)
DBCD_Bin(n0 = 20, p, k, ssn, theta0 = NULL, target.alloc = "RPW", r = 2,
nsim = 2000, mRate = NULL, alpha = 0.05, allocation = "DBCD",
erade.alpha = 0.5, lower.bound = 0, monitor = NULL, test.fun = NULL,
typeI = FALSE, seed = NULL)
n0 |
A positive integer and a multiple of |
p |
A vector of length |
k |
A positive integer. The number of treatment groups in the trial ( |
ssn |
A positive integer. The total number of participants in each simulated trial. |
theta0 |
A vector of length |
target.alloc |
Desired allocation proportion. One of |
r |
A non-negative number. The tuning parameter of Hu and Zhang's allocation function, used when |
nsim |
A positive integer. The number of simulated trials, with a default value of 2000. |
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 |
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. |
erade.alpha |
A number between 0 and 1. The degree of randomization of ERADE, used when |
lower.bound |
A number between 0 and |
monitor |
An optional object created by |
test.fun |
An optional function |
typeI |
Logical. If |
seed |
An optional integer passed to |
The objective of Hu and Zhang's doubly biased coin design is to allocate patients sequentially while closely approximating the desired allocation proportion, which is a function of certain unknown parameters related to the response variable under each treatment.
The process begins by assigning n0 patients 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 desired allocation proportion is calculated. Then Hu and Zhang's allocation function is applied to determine the probabilities for the next patient to be assigned to each treatment group, which drive the allocation proportion towards the desired one. This process is repeated sequentially for each patient until the predetermined number of patients has been allocated.
This methodology was introduced by Hu and Zhang (2004) in their paper 'Asymptotic properties of doubly adaptive biased coin designs for multitreatment clinical trials'.
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.
Sequential monitoring. With monitor = sqMonitor(t, spend) (two arms only) the trial is analysed at the information times t. Looks are taken after ceiling(t * ssn) patients. At each look the Wald statistic Z = (\hat\theta_1 - \hat\theta_2)/\sqrt{\hat v_1/n_1 + \hat v_2/n_2} is computed from all patients enrolled so far, with \hat p_k(1 - \hat p_k) as variance estimates (missing responses are excluded), and the trial stops and rejects the null hypothesis as soon as |Z| reaches the boundary of sqBoundary. Zhu and Hu (2010) showed that under the DBCD the sequential statistics are asymptotically a Brownian motion in the information time, so alpha spending boundaries keep the type I error. Their theory covers two arms and the DBCD, and the same boundaries are used with ERADE. The result then also contains the stopping probability at each look and the expected sample size.
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. |
parameter |
The true success rates used in the simulations, named |
propotion |
The mean allocation proportion of each arm over the simulations, named |
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 |
type I error |
Only if |
boundary |
Only if |
stopping probability |
Only if |
expected sample size |
Only if |
data: stage |
Only if |
data: sample size |
Only if |
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")}
Zhu, H. and Hu, F. (2010). Sequential monitoring of response-adaptive randomized clinical trials. The Annals of Statistics, 38(4), 2218-2241. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1214/10-AOS796")}
res <- DBCD_Bin(n0 = 20, p = c(0.7, 0.8), k = 2, ssn = 300, theta0 = NULL,
target.alloc = "RPW", r = 2, nsim = 50, mRate = NULL, alpha = 0.05)
res
## ERADE instead of the DBCD allocation function
res.erade <- DBCD_Bin(n0 = 20, p = c(0.7, 0.8), k = 2, ssn = 200, target.alloc = "RSIHR",
nsim = 50, allocation = "ERADE", erade.alpha = 0.5, seed = 1)
res.erade
## three arms with the optimal RSIHR target of Tymofyeyev, Rosenberger and Hu (2007)
res.opt <- DBCD_Bin(n0 = 30, p = c(0.5, 0.7, 0.8), k = 3, ssn = 200,
target.alloc = "OptimalRSIHR", lower.bound = 0.1, nsim = 20, seed = 1)
res.opt[["propotion"]]
## group sequential monitoring with two interim looks (O'Brien-Fleming-type spending)
res.sq <- DBCD_Bin(n0 = 20, p = c(0.6, 0.8), k = 2, ssn = 200, target.alloc = "RSIHR",
nsim = 50, monitor = sqMonitor(c(1/3, 2/3)), seed = 1)
res.sq[["stopping probability"]]
res.sq[["expected sample size"]]
## a user-supplied test: Fisher's exact test
fisher <- function(outcome, assignment)
fisher.test(table(factor(assignment, 1:2), factor(outcome, 0:1)))$p.value
res.f <- DBCD_Bin(n0 = 20, p = c(0.6, 0.8), k = 2, ssn = 100, nsim = 20,
test.fun = fisher, seed = 1)
res.f[["power"]]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.