Learn R Programming

carat (version 1.1)

HuHuCAR.sim: Hu and Hu's General Covariate-Adaptive Randomization with Covariate Data Generating Mechanism

Description

Allocates patients to one of two treatments using general covariate-adaptive randomization proposed by Hu Y, Hu F (2012) <Doi:10.1214/12-AOS983>, by simulating covariate profiles based on the assumption of independence between covariates and levels within each covariate.

Usage

# S3 method for carandom
HuHuCAR.sim(n = 1000, cov_num = 2, level_num = c(2, 2), 
            pr = rep(0.5, 4), omega = NULL, p = 0.85)

Arguments

n

the number of patients. The default is 1000.

cov_num

the number of covariates. The default is 2.

level_num

the vector of level numbers for each covariate. Hence the length of level_num should be equal to the number of covariates. The default is c(2, 2).

pr

the vector of probabilities. Under the assumption of independence between covariates, pr is a vector containing probabilities for each level of each covariate. The length of pr should correspond to the number of all levels, and the vector sum of pr should be equal to cov_num. The default is pr = rep(0.5, 4), which implies that cov_num = 2, and level_num = c(2, 2).

omega

the vector of weights at the overall, within-stratum, and maginal levels. It is required that at least one element is larger than 0. If omega = NULL (default), it weights the overall, within-stratum as well as marginal levels with porportion 1/cov_num.

p

the probability of assigning one patient to treatment 1. p should be larger than 1/2 to obtain balance. The default is 0.85.

Value

See HuHuCAR.

Details

See HuHuCAR.

See Also

See HuHuCAR for allocating patients with complete covariate data; See HuHuCAR.ui for the command-line user interface.