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).
sreg.rgen(
n,
Nmax = 50,
n.strata = 10,
tau.vec = c(0),
gamma.vec = c(0.4, 0.2, 1),
cluster = TRUE,
is.cov = TRUE,
small.strata = FALSE,
k = 3,
treat.sizes = c(1, 1, 1)
)An object that is a `data.frame` with \(n\) observations containing the generated values of the following variables:
Y: a numeric \(n \times 1\) vector of observed outcomes
S: a numeric \(n \times 1\) vector of strata indicators
D: a numeric \(n \times 1\) vector of treatments indexed by \(\{0, 1, 2, \ldots\}\), where \(\code{D} = 0\) denotes the control
G.id: a numeric \(n \times 1\) vector of cluster indicators
X: a data.frame with columns representing the covariate values for every observation
a total number of observations in a sample
a maximum size of generated clusters (maximum number of observations in a cluster)
an integer specifying the number of strata
a numeric \(1 \times |\mathcal A|\) vector of treatment effects, where \(|\mathcal A|\) represents the number of treatments
a numeric \(1 \times 3\) vector of parameters corresponding to covariates
a TRUE/FALSE argument indicating whether the dgp should use a cluster-level treatment assignment or individual-level
a TRUE/FALSE argument indicating whether the dgp should include covariates or not
a TRUE/FALSE argument indicating whether the data-generating process should use a small-strata design (e.g., matched pairs, n-tuples)
an integer specifying the number of units per stratum when small.strata = TRUE
a numeric \(1 \times (|\mathcal A| + 1)\) vector specifying the number of units assigned to each treatment within a stratum; the first element corresponds to control units (\(D = 0\)), the second to the first treatment (\(D = 1\)), and so on
data <- sreg.rgen(n = 1000, tau.vec = c(0), n.strata = 4, cluster = TRUE)
Run the code above in your browser using DataLab