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,
  z_shape,
  v_shape,
  beta,
  gamma,
  delta
)

Arguments

sample_size

An integer specifying the sample size of the generated data set.

x_mu

A numeric value specifying the mean of x predictors generated from a Normal distribution.

x_sigma

A positive numeric value specifying the standard deviation of x predictors generated from a Normal distribution.

z_shape

A positive numeric value specifying the shape parameter of z predictors generated from a Gamma distribution.

v_shape

A positive numeric value specifying the shape parameter of v predictors generated from a Gamma distribution.

beta

A column matrix of \beta parameter values (intercept, slope) to generate data under in the true outcome mechanism.

gamma

A numeric matrix of \gamma parameters to generate data under in the first-stage observation mechanism. In matrix form, the gamma matrix rows correspond to intercept (row 1) and slope (row 2) terms. The gamma parameter matrix columns correspond to the true outcome categories Y \in \{1, 2\}.

delta

A numeric array of \delta parameters to generate data under the second-stage observation mechanism. In array form, the delta matrix rows correspond to intercept (row 1) and slope (row 2) terms. The matrix columns correspond to first-stage observed outcome categories. The third dimension of the delta array is indexed by the true outcome categories.

Value

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 Y*. Rows of the matrix correspond to each subject. Columns of the matrix correspond to each observed outcome category. Each row contains exactly one 0 entry and exactly one 1 entry.

obs_Ytilde_matrix

A numeric matrix of indicator variables (0, 1) for the second-stage observed outcome Y*. Rows of the matrix correspond to each subject. Columns of the matrix correspond to each observed outcome category. Each row contains exactly one 0 entry and exactly one 1 entry.

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 x predictor.

z_design_matrix

The design matrix for the z predictor.

v_design_matrix

The design matrix for the v predictor.

Examples

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"]])

[Package COMBO version 1.0.0 Index]