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 1 \times |\mathcal A| vector of treatment effects, where |\mathcal A| represents the number of treatments

gamma.vec

a numeric 1 \times 3 vector of parameters corresponding to covariates

cluster

a TRUE/FALSE argument indicating whether the dgp should use a cluster-level treatment assignment or individual-level

is.cov

a TRUE/FALSE argument indicating whether the dgp should include covariates or not

Value

An object that is a 'data.frame' with n observations containing the generated values of the following variables:

Examples

data <- sreg.rgen(n = 1000, tau.vec = c(0), n.strata = 4, cluster = TRUE)

[Package sreg version 1.0.0 Index]