ARMM {CARM} | R Documentation |
Adaptive Randomization via Mahalanobis distance for Multi-arm design
Description
Randomize patients into treatment groups for multi-arm trials using ARMM proposed by Haoyu Yang, Yichen Qin, Yang Li, Fan Wang, and Feifang Hu.(2022)
Usage
ARMM(covariate, assignment, K, q = 0.75, method)
Arguments
covariate |
a data frame. A row of the dataframe corresponds to the covariate profile of a patient. |
assignment |
a vector. If partial patients had been allocated , please input their allocation. IF all the patients are not be allocated, please input 'assignment = NA' directly. |
K |
an integer; number of arms of the trial. |
q |
the biased coin probability.
|
method |
Methods for calculating Mahalanobis distance, input one of these texts: 'mean', 'max' or 'median'. |
Details
Suppose n
units (participants) are to be assigned to K
treatment groups. For each unit i, i = 1, ..., n
and
treatment j, j = 1, ..., K
, define the assignment
matrix [T_{ij}]^{n*K}
, where
T_{ij}=1
indicates unit i
receives treatment j
.
Consider p
continuous covariates, let x_i =
(x_{i1},...,x_{in})^T
.
The proposed method, namely the adaptive randomization via Mahalanobis distance for multi-arm design (ARMM), is outlined below. The implement of ARMM is similar to ARM.
First assume that n
units are in a sequence
and then assign the first K
units to K
treatment
groups randomly
as the initialization. Then,
the following units are assigned in blocks of K
sequentially and
adaptively until all the units
are assigned. For K
units are assigned to K
groups, there are in total K!
possible allocations.
Calculate K!
potential overall
covariate imbalance measurement
according to pairwise Mahalanobis
distance under the K!
possible allocations.
Choose the allocation which corresponds to the smallest
Mahalanobis
distance with a probability of q
across all potential allocations.
Repeat the process until all units are assigned.
For any pair of treatments s
and t
among the K
treatment groups, calculate the Mahalanobis distance by:
M_{s,t}(n) = 2n/K/K(\hat{x}_1 -\hat{x}_2)^Tcov(x)^{-1}(\hat{x}_1 -\hat{x}_2)
In total, there are C_K^2
pairs of Mahalanobis
distances among K
treatment groups.Finally, calculate
the mean, the median or the maximum to represent the total imbalance.
See the reference for more details.
Value
An object of class "ARMM" is a list containing the following components:
assignment |
Allocation of patients. |
sample_size |
The number of patients from treatment 1 to treatment |
Mahalanobis_Distance |
Mahalanobis distance among treatment groups . |
References
Yang H, Qin Y, Wang F, et al. Balancing covariates in multi-arm trials via adaptive randomization. Computational Statistics & Data Analysis, 2023, 179: 107642. https://doi.org/10.1016/j.csda.2022.107642
Examples
library(MASS)
#simulate covariates of patients
p <- 6; n <- 30
sigma <- diag(p); mean <- c(rep(0,p))
data <- mvrnorm(n, mean, sigma)
covariate <- as.data.frame(data)
#IF all the patients are not be allocated
ARMM(covariate = covariate, assignment = NA, K = 3, q = 0.75, method = 'mean')
#IF you had allocated partial patients
ARMM(covariate = covariate, assignment = c(1,2), K=4, q=0.75, method = 'max')