CovAdptRnd {drcarlate}R Documentation

Generate treatment assignment under various CARs

Description

Generate treatment assignment under various CARs.

Usage

CovAdptRnd(rndflag, S, pi)

Arguments

rndflag

Index of the assignment rule. 1 for SRS; 2 for WEI; 3 for BCD; 4 for SBR

S

A nx1 vector.

pi

Targeted assignment probability across strata. It should be a vector with the length of max(S), It should be noted that the treatment assignment process is independent of pi when rndflag == 2 or 3.

Value

A nx1 treatment assignment vector generated according to the specified method.

References

Jiang L, Linton O B, Tang H, Zhang Y. Improving estimation efficiency via regression-adjustment in covariate-adaptive randomizations with imperfect compliance [J]. 2022.

Examples

CovAdptRnd(rndflag = 1, S = matrix(sample(1:4,100,TRUE)), pi = c(0.5, 0.5, 0.5, 0.5))
CovAdptRnd(rndflag = 2, S = matrix(sample(1:4,100,TRUE)), pi = c(0.5, 0.5, 0.5, 0.5))
CovAdptRnd(rndflag = 3, S = matrix(sample(1:4,100,TRUE)), pi = c(0.5, 0.5, 0.5, 0.5))
CovAdptRnd(rndflag = 4, S = matrix(sample(1:4,100,TRUE)), pi = c(0.5, 0.5, 0.5, 0.5))


[Package drcarlate version 1.2.0 Index]