COMBO_data_2stage {COMBO} | R Documentation |
Generate data to use in two-stage COMBO Functions
Description
Generate data to use in two-stage COMBO Functions
Usage
COMBO_data_2stage(
sample_size,
x_mu,
x_sigma,
z1_shape,
z2_shape,
beta,
gamma1,
gamma2
)
Arguments
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
|
z1_shape |
A positive numeric value specifying the shape parameter of
|
z2_shape |
A positive numeric value specifying the shape parameter of
|
beta |
A column matrix of |
gamma1 |
A numeric matrix of |
gamma2 |
A numeric array of |
Value
COMBO_data_2stage
returns a list of generated data elements:
obs_Ystar1 |
A vector of first-stage observed outcomes. |
obs_Ystar2 |
A vector of second-stage observed outcomes. |
true_Y |
A vector of true outcomes. |
obs_Ystar1_matrix |
A numeric matrix of indicator variables (0, 1) for the first-stage observed
outcome |
obs_Ystar2_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. |
z1 |
A vector of generated predictor values in the first-stage observation mechanism from the Gamma distribution. |
z2 |
A vector of generated predictor values in the second-stage observation mechanism from the Gamma distribution. |
x_design_matrix |
The design matrix for the |
z1_design_matrix |
The design matrix for the |
z2_design_matrix |
The design matrix for the |
Examples
set.seed(123)
n <- 1000
x_mu <- 0
x_sigma <- 1
z1_shape <- 1
z2_shape <- 1
true_beta <- matrix(c(1, -2), ncol = 1)
true_gamma1 <- matrix(c(.5, 1, -.5, -1), nrow = 2, byrow = FALSE)
true_gamma2 <- 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,
z1_shape = z1_shape, z2_shape = z2_shape,
beta = true_beta, gamma1 = true_gamma1, gamma2 = true_gamma2)
table(my_data[["obs_Ystar2"]], my_data[["obs_Ystar1"]], my_data[["true_Y"]])