AdjBCD {carat}R Documentation

Covariate-adjusted Biased Coin Design

Description

Allocates patients to one of two treatments based on covariate-adjusted biased coin design as proposed by Baldi Antognini A, Zagoraiou M (2011) <doi:10.1093/biomet/asr021>.

Usage

AdjBCD(data, a = 3)

Arguments

data

a data frame. A row of the dataframe corresponds to the covariate profile of a patient.

a

a design parameter governing the degree of randomness. The default is 3.

Details

Consider II covaraites and mim_i levels for the iith covariate, i=1,,Ii=1,\ldots,I. TjT_j is the assignment of the jjth patient and Zj=(k1,,kI)Z_j = (k_1,\dots,k_I) indicates the covariate profile of the jjth patient, j=1,,nj=1,\ldots,n. For convenience, (k1,,kI)(k_1,\dots,k_I) and (i;ki)(i;k_i) denote stratum and margin, respectively. Dj(.)D_j(.) is the difference between numbers of patients assigned to treatment 11 and treatment 22 at the corresponding level after jj patients have been assigned.

Let FaF^a be a decreasing and symmetric function of Dj(.)D_j(.), which depends on a design parameter a0a\ge 0. Then, the probability of allocating the (j+1)(j+1)th patient to treatment 1 is Fa(Dj(.))F^a(D_j(.)), where

Fa(x)=1xa+1,F^a(x)=\frac{1}{x^a + 1},

for x1x\ge 1,

Fa(x)=1/2,F^a(x)=1 / 2,

for x=0 x = 0, and

Fa(x)=xaxa+1,F^a(x)=\frac{|x|^a}{|x|^a + 1},

for x1.x\le -1. As aa goes to \infty, the design becomes more deteministic.

Details of the procedure can be found in Baldi Antognini and M. Zagoraiou (2011).

Value

It returns an object of class "carandom".

An object of class "carandom" is a list containing the following components:

datanumeric

a bool indicating whether the data is a numeric data frame.

covariates

a character string giving the name(s) of the included covariates.

strt_num

the number of strata.

cov_num

the number of covariates.

level_num

a vector of level numbers for each covariate.

n

the number of patients.

Cov_Assig

a (cov_num + 1) * n matrix containing covariate profiles for all patients and the corresponding assignments. The iith column represents the iith patient. The first cov_num rows include patients' covariate profiles, and the last row contains the assignments.

assignments

the randomization sequence.

All strata

a matrix containing all strata involved.

Diff

a matrix with only one column. There are final differences at the overall, within-stratum, and within-covariate-margin levels.

method

a character string describing the randomization procedure to be used.

Data Type

a character string giving the data type, Real or Simulated.

framework

the framework of the used randomization procedure: stratified randomization, or model-based method.

data

the data frame.

References

Baldi Antognini A, Zagoraiou M. The covariate-adaptive biased coin design for balancing clinical trials in the presence of prognostic factors[J]. Biometrika, 2011, 98(3): 519-535.

Ma W, Ye X, Tu F, Hu F. carat: Covariate-Adaptive Randomization for Clinical Trials[J]. Journal of Statistical Software, 2023, 107(2): 1-47.

See Also

See AdjBCD.sim for allocating patients with covariate data generating mechanism; See AdjBCD.ui for the command-line user interface.

Examples

# a simple use
## Real Data
## create a dataframe
df <- data.frame("gender" = sample(c("female", "male"), 1000, TRUE, c(1 / 3, 2 / 3)), 
                 "age" = sample(c("0-30", "30-50", ">50"), 1000, TRUE), 
                 "jobs" = sample(c("stu.", "teac.", "others"), 1000, TRUE), 
                 stringsAsFactors = TRUE)
Res <- AdjBCD(df, a = 2)
## view the output
Res

  ## view all patients' profile and assignments
  Res$Cov_Assig
  

## Simulated Data
n <- 1000
cov_num <- 3
level_num <- c(2, 3, 5) 
# Set pr to follow two tips:
#(1) length of pr should be sum(level_num);
#(2) sum of probabilities for each margin should be 1.
pr <- c(0.4, 0.6, 0.3, 0.4, 0.3, rep(0.2, times = 5))
# set the design parameter
a <- 1.8
# obtain result
Res.sim <- AdjBCD.sim(n, cov_num, level_num, pr, a)

  # view the assignments of patients
  Res.sim$Cov_Assig[cov_num + 1, ]
  # view the differences between treatment 1 and treatment 2 at all levels
  Res.sim$Diff
  

[Package carat version 2.2.1 Index]