DBCD_Cont: Hu and Zhang's Doubly Biased Coin Design with Continuous...

View source: R/groupRAR_functions.R

DBCD_ContR Documentation

Hu and Zhang's Doubly Biased Coin Design with Continuous Response Type

Description

Simulating Hu and Zhang's doubly biased coin design with continuous 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

DBCD_Cont(n0 = 20, theta, k, ssn, theta0 = NULL, target.alloc = "Neyman",
          r = 2, nsim = 2000, alpha = 0.05, allocation = "DBCD",
          erade.alpha = 0.5, lower.bound = 0, monitor = NULL, test.fun = NULL,
          typeI = FALSE, seed = NULL)

Arguments

n0

A positive integer and a multiple of k. The number of initial patients assigned by restricted randomization for initial parameter estimation.

theta

A numerical vector of length 2k giving the true mean and variance of each treatment, used to generate data for the simulations. For example, with k = 2 use theta = c(13, 4.0^2, 15, 2.5^2).

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.

theta0

Currently unused. Kept for backward compatibility.

target.alloc

Desired allocation proportion. One of "Neyman", "ZR", "OptimalNeyman" or "DaOptimal". The default is "Neyman". 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.

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 "ZR" and "OptimalNeyman". The default is 0.

monitor

An optional object created by sqMonitor for group sequential monitoring of a two-arm trial. For each information time t, a look is taken after ceiling(t * ssn) patients, and the trial stops for efficacy as soon as the Wald statistic crosses the boundary of sqBoundary. The first look must come after the n0 initial patients. Cannot be combined with test.fun. The default NULL gives a fixed sample design. See Details.

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). Cannot be combined with monitor.

typeI

Logical. If TRUE, the simulation is repeated under the null hypothesis, with the mean of every arm set to the average of the means in theta and the variance of each arm kept, 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

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. "Neyman" is proportional to \sigma_k. "ZR" is the allocation of Zhang and Rosenberger (2006), which minimizes the total expected response (smaller responses are better, and all means must be positive). For two arms it is their rule (7): \rho_1 = \sigma_1\sqrt{\mu_2}/(\sigma_1\sqrt{\mu_2} + \sigma_2\sqrt{\mu_1}) when this assigns more patients to the arm with the smaller mean, and 1/2 otherwise. For three or more arms it minimizes the total expected response for a fixed noncentrality parameter of the chi-squared test of equal means, with every proportion at least lower.bound, the continuous analogue of Tymofyeyev, Rosenberger and Hu (2007). "OptimalNeyman" minimizes the total sample size under the same constraints and equals "Neyman" for two arms with lower.bound = 0. For three or more arms a positive lower.bound such as 0.1 is recommended with "ZR" and "OptimalNeyman". "DaOptimal" is proportional to \sigma_k^{4/3}. While the target cannot be estimated (for example with fewer than two responses in an arm) equal allocation is used.

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 the sample variances 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.

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.

parameter

The true means and variances used in the simulations, named muA, sigma2A, muB, ...

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 response over the simulations (for continuous responses this element holds the mean response, not a failure rate).

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 means. 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 (positions after an early stop are NA).

type I error

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

boundary

Only if monitor is given. The boundaries for |Z| at the looks.

stopping probability

Only if monitor is given. The proportion of simulated trials that stop at each look (the last look is the final analysis).

expected sample size

Only if monitor is given. The mean number of enrolled patients.

data: stage

Only if monitor is given. The look at which each simulated trial stopped.

data: sample size

Only if monitor is given. The number of patients enrolled in 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")}

Hu, F., Zhang, L. X., Cheung, S. H. and Chan, W. S. (2008). Doubly adaptive biased coin designs with delayed responses. Canadian Journal of Statistics, 36(4), 541-559.

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")}

Zhang, L. and Rosenberger, W. F. (2006). Response-adaptive randomization for clinical trials with continuous outcomes. Biometrics, 62(2), 562-569. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1111/j.1541-0420.2005.00496.x")}

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")}

See Also

See DBCD_Bin for simulations of Hu and Zhang's doubly biased coin design with binary response.

See dyldDBCD_Cont for simulations of Hu and Zhang's doubly biased coin design with delayed continuous response.

Examples

# A simple use
## Arguments for generating the simulated data
theta = c(13, 4.0^2, 15, 2.5^2)
k = 2
ssn = 88

res <- DBCD_Cont(n0 = 20, theta = theta, k = k, ssn = ssn, theta0 = NULL,
                 target.alloc = "Neyman", r = 2, nsim = 100, alpha = 0.05)

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

## three arms with the k-arm ZR target and ERADE
res3 <- DBCD_Cont(n0 = 30, theta = c(13, 16, 15, 6.25, 14, 9), k = 3, ssn = 150,
                  target.alloc = "ZR", lower.bound = 0.1, nsim = 30,
                  allocation = "ERADE", seed = 1)
summary(res3)

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

Related to DBCD_Cont in grouprar...