COMBO_data_2stage {COMBO} | R Documentation |
Generate Data to use in two-stage COMBO Functions
COMBO_data_2stage(
sample_size,
x_mu,
x_sigma,
z_shape,
v_shape,
beta,
gamma,
delta
)
sample_size |
An integer specifying the sample size of the generated data set. |
x_mu |
A numeric value specifying the mean of |
x_sigma |
A positive numeric value specifying the standard deviation of
|
z_shape |
A positive numeric value specifying the shape parameter of
|
v_shape |
A positive numeric value specifying the shape parameter of
|
beta |
A column matrix of |
gamma |
A numeric matrix of |
delta |
A numeric array of |
COMBO_data_2stage
returns a list of generated data elements:
obs_Ystar |
A vector of first-stage observed outcomes. |
obs_Ytilde |
A vector of second-stage observed outcomes. |
true_Y |
A vector of true outcomes. |
obs_Ystar_matrix |
A numeric matrix of indicator variables (0, 1) for the first-stage observed
outcome |
obs_Ytilde_matrix |
A numeric matrix of indicator variables (0, 1) for the second-stage observed
outcome |
x |
A vector of generated predictor values in the true outcome mechanism, from the Normal distribution. |
z |
A vector of generated predictor values in the first-stage observation mechanism from the Gamma distribution. |
v |
A vector of generated predictor values in the second-stage observation mechanism from the Gamma distribution. |
x_design_matrix |
The design matrix for the |
z_design_matrix |
The design matrix for the |
v_design_matrix |
The design matrix for the |
set.seed(123)
n <- 500
x_mu <- 0
x_sigma <- 1
z_shape <- 1
v_shape <- 1
true_beta <- matrix(c(1, -2), ncol = 1)
true_gamma <- matrix(c(.5, 1, -.5, -1), nrow = 2, byrow = FALSE)
true_delta <- array(c(1.5, 1, .5, .5, -.5, 0, -1, -1), dim = c(2, 2, 2))
my_data <- COMBO_data_2stage(sample_size = n,
x_mu = x_mu, x_sigma = x_sigma,
z_shape = z_shape, v_shape = v_shape,
beta = true_beta, gamma = true_gamma, delta = true_delta)
table(my_data[["obs_Ytilde"]], my_data[["obs_Ystar"]], my_data[["true_Y"]])