COMBO_EM_2stage {COMBO}R Documentation

EM-Algorithm Estimation of the Two-Stage Binary Outcome Misclassification Model

Description

Jointly estimate \beta, \gamma, \delta parameters from the true outcome, first-stage observation, and second-stage observation mechanisms, respectively, in a two-stage binary outcome misclassification model.

Usage

COMBO_EM_2stage(
  Ystar,
  Ytilde,
  x_matrix,
  z_matrix,
  v_matrix,
  beta_start,
  gamma_start,
  delta_start,
  tolerance = 1e-07,
  max_em_iterations = 1500,
  em_method = "squarem"
)

Arguments

Ystar

A numeric vector of indicator variables (1, 2) for the first-stage observed outcome Y*. There should be no NA terms. The reference category is 2.

Ytilde

A numeric vector of indicator variables (1, 2) for the second-stage observed outcome \tilde{Y}. There should be no NA terms. The reference category is 2.

x_matrix

A numeric matrix of covariates in the true outcome mechanism. x_matrix should not contain an intercept and no values should be NA.

z_matrix

A numeric matrix of covariates in the first-stage observation mechanism. z_matrix should not contain an intercept and no values should be NA.

v_matrix

A numeric matrix of covariates in the second-stage observation mechanism. v_matrix should not contain an intercept and no values should be NA.

beta_start

A numeric vector or column matrix of starting values for the \beta parameters in the true outcome mechanism. The number of elements in beta_start should be equal to the number of columns of x_matrix plus 1.

gamma_start

A numeric vector or matrix of starting values for the \gamma parameters in the first-stage observation mechanism. In matrix form, the gamma_start matrix rows correspond to parameters for the Y* = 1 first-stage observed outcome, with the dimensions of z_matrix plus 1, and the gamma parameter matrix columns correspond to the true outcome categories Y \in \{1, 2\}. A numeric vector for gamma_start is obtained by concatenating the gamma matrix, i.e. gamma_start <- c(gamma_matrix).

delta_start

A numeric array of starting values for the \delta parameters in the second-stage observation mechanism. The first dimension (matrix rows) of delta_start correspond to parameters for the \tilde{Y} = 1 second-stage observed outcome, with the dimensions of the v_matrix plus 1. The second dimension (matrix columns) correspond to the first-stage observed outcome categories Y^* \in \{1, 2\}. The third dimension of delta_start corresponds to to the true outcome categories Y \in \{1, 2\}.

tolerance

A numeric value specifying when to stop estimation, based on the difference of subsequent log-likelihood estimates. The default is 1e-7.

max_em_iterations

An integer specifying the maximum number of iterations of the EM algorithm. The default is 1500.

em_method

A character string specifying which EM algorithm will be applied. Options are "em", "squarem", or "pem". The default and recommended option is "squarem".

Value

COMBO_EM_2stage returns a data frame containing four columns. The first column, Parameter, represents a unique parameter value for each row. The next column contains the parameter Estimates, followed by the standard error estimates, SE. The final column, Convergence, reports whether or not the algorithm converged for a given parameter estimate.

Estimates are provided for the two-stage binary misclassification model.

Examples


set.seed(123)
n <- 1000
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"]])

beta_start <- rnorm(length(c(true_beta)))
gamma_start <- rnorm(length(c(true_gamma)))
delta_start <- rnorm(length(c(true_delta)))

EM_results <- COMBO_EM_2stage(Ystar = my_data[["obs_Ystar"]],
                              Ytilde = my_data[["obs_Ytilde"]],
                              x_matrix = my_data[["x"]],
                              z_matrix = my_data[["z"]],
                              v_matrix = my_data[["v"]],
                              beta_start = beta_start,
                              gamma_start = gamma_start,
                              delta_start = delta_start)

EM_results

[Package COMBO version 1.0.0 Index]