| sreg.rgen {sreg} | R Documentation |
Generate a Pseudo-Random Sample under the Stratified Block Randomization Design
Description
The function generates the observed outcomes, treatment assignments, strata indicators, cluster indicators, cluster sizes, and covariates for estimating the treatment effect within the context of a stratified block randomization design under the covariate-adaptive randomization (CAR).
Usage
sreg.rgen(
n,
Nmax = 50,
n.strata,
tau.vec = c(0),
gamma.vec = c(0.4, 0.2, 1),
cluster = TRUE,
is.cov = TRUE
)
Arguments
n |
a total number of observations in a sample |
Nmax |
a maximum size of generated clusters (maximum number of observations in a cluster) |
n.strata |
an integer specifying the number of strata |
tau.vec |
a numeric |
gamma.vec |
a numeric |
cluster |
a |
is.cov |
a |
Value
An object that is a 'data.frame' with n observations containing the generated values of the following variables:
-
Y: a numericn \times 1vectorof observed outcomes -
S: a numericn \times 1vectorof strata indicators -
D: a numericn \times 1vectorof treatments indexed by\{0, 1, 2, \ldots\}, where\code{D} = 0denotes the control -
G.id: a numericn \times 1vectorof cluster indicators -
X: adata.framewith columns representing the covariate values for every observation
Examples
data <- sreg.rgen(n = 1000, tau.vec = c(0), n.strata = 4, cluster = TRUE)