nextAlloc: Allocation Probabilities for an Ongoing Trial

View source: R/groupRAR_tools.R

nextAllocR Documentation

Allocation Probabilities for an Ongoing Trial

Description

Computes the allocation probabilities of the next patient, or of the next group of patients, in an ongoing response-adaptive randomized trial from the assignments and responses observed so far, and optionally draws the assignments. The same estimates, targets and allocation functions as in the simulation functions (for example DBCD_Bin and Group.DBCD_Bin) are used.

Usage

nextAlloc(alloc, outcome, k, response = "binary", target.alloc = NULL,
          allocation = "DBCD", r = 2, erade.alpha = 0.5, lower.bound = 0,
          theta0 = NULL, size = 1)

Arguments

alloc

An integer vector with the treatment (1 to k) of every patient enrolled so far.

outcome

A numeric vector of the same length as alloc with the response of each patient (0 or 1 for binary responses). Use NA for responses that are not observed yet or are missing.

k

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

response

The response type, "binary" (default) or "continuous".

target.alloc

Desired allocation proportion. For binary responses one of "Neyman", "RSIHR", "RPW", "WeisUrn", "OptimalNeyman" or "OptimalRSIHR", with default "RPW". For continuous responses one of "Neyman", "ZR", "OptimalNeyman" or "DaOptimal", with default "Neyman". See DBCD_Bin and DBCD_Cont for their definitions.

allocation

The allocation function, "DBCD" (default, Hu and Zhang, 2004) or "ERADE" (Hu, Zhang and He, 2009; Alkhnefr, Hu and Zhai, 2025). See DBCD_Bin.

r

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

erade.alpha

A number between 0 and 1. The degree of randomization of ERADE, used when allocation = "ERADE". The default is 0.5.

lower.bound

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

theta0

A vector of length k used to smooth the success-rate estimates of binary responses, \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. Not used for continuous responses.

size

A non-negative integer. The number of assignments to draw with the returned probabilities, for example the size of the next group. The default is 1, and 0 draws none.

Details

The parameters of each arm are estimated from the observed responses only (NA values are ignored): smoothed success rates for binary responses, and the mean and variance (which needs at least two responses) for continuous responses. The current allocation proportions use all enrolled patients, including those whose responses are not available yet. If the target cannot be estimated, equal allocation is used as the target, and with no enrolled patients every arm has probability 1/k. All patients of a group are assigned independently with the same probabilities, as in the group designs of Zhai, Li, Zhang and Hu (2024).

Value

A list with the following elements.

prob

The allocation probabilities of the next patient for each arm, named treatment A, treatment B, ...

target

The estimated target allocation proportions.

estimate

The parameter estimates, named pA, pB, ... or muA, sigma2A, ...

assignment

An integer vector of size assignments drawn with probabilities prob.

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

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

See Also

DBCD_Bin, DBCD_Cont, Group.DBCD_Bin for simulating the designs.

Examples

## 30 patients enrolled in a three-arm trial, the last three responses are pending
set.seed(1)
alloc <- sample(1:3, 30, replace = TRUE)
outcome <- rbinom(30, 1, c(0.6, 0.7, 0.8)[alloc])
outcome[28:30] <- NA

## probabilities for the next patient with the DBCD and the RSIHR target
nextAlloc(alloc, outcome, k = 3, target.alloc = "RSIHR")

## assignments for the next group of 5 patients with ERADE
nextAlloc(alloc, outcome, k = 3, target.alloc = "RSIHR", allocation = "ERADE",
          size = 5)$assignment

## continuous responses
y <- rnorm(30, mean = c(13, 15, 14)[alloc], sd = 3)
nextAlloc(alloc, y, k = 3, response = "continuous", target.alloc = "Neyman")$prob

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

Related to nextAlloc in grouprar...