COMBO_EM_2stage {COMBO} | R Documentation |
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.
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"
)
Ystar |
A numeric vector of indicator variables (1, 2) for the first-stage observed
outcome |
Ytilde |
A numeric vector of indicator variables (1, 2) for the second-stage
observed outcome |
x_matrix |
A numeric matrix of covariates in the true outcome mechanism.
|
z_matrix |
A numeric matrix of covariates in the first-stage observation mechanism.
|
v_matrix |
A numeric matrix of covariates in the second-stage observation mechanism.
|
beta_start |
A numeric vector or column matrix of starting values for the |
gamma_start |
A numeric vector or matrix of starting values for the |
delta_start |
A numeric array of starting values for the |
tolerance |
A numeric value specifying when to stop estimation, based on
the difference of subsequent log-likelihood estimates. The default is |
max_em_iterations |
An integer specifying the maximum number of
iterations of the EM algorithm. The default is |
em_method |
A character string specifying which EM algorithm will be applied.
Options are |
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.
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