Learn R Programming

carat (version 1.1)

DoptBCD.sim: Atkinson's \(D_A\)-optimal Biased Coin Design with Covariate Data Generating Mechanism

Description

Allocates patients generated by simulating covariates-profile under the assumption of independence between covariates and levels within each covariate, to one of two treatments based on the \(D_A\)-optimal biased coin design in the presence of prognostic factors, as proposed by Atkinson A C (1982) <Doi:10.2307/2335853>.

Usage

# S3 method for carandom
DoptBCD.sim(n = 1000, cov_num = 2, level_num = c(2, 2), 
            pr = rep(0.5, 4))

Arguments

n

the number of patients. Default is 1000.

cov_num

the number of covariates. 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 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).

Value

See DoptBCD.

Details

See DoptBCD.

See Also

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