EM Algorithm Function for Estimation of the Misclassification Model
EM_function_normalY_XM.Rd
Function is for cases with \(Y \sim Normal\) and with an interaction term in the outcome mechanism.
Usage
EM_function_normalY_XM(
param_current,
obs_mediator,
obs_outcome,
X,
Z,
c_matrix,
sample_size,
n_cat
)
Arguments
- param_current
A numeric vector of regression parameters, in the order \(\beta, \gamma, \theta\). The \(\gamma\) vector is obtained from the matrix form. In matrix form, the gamma parameter matrix rows correspond to parameters for the
M* = 1
observed mediator, with the dimensions ofZ
. In matrix form, the gamma parameter matrix columns correspond to the true mediator categories \(j = 1, \dots,\)n_cat
. The numeric vectorgamma_v
is obtained by concatenating the gamma matrix, i.e.gamma_v <- c(gamma_matrix)
.- obs_mediator
A numeric vector of indicator variables (1, 2) for the observed mediator
M*
. There should be noNA
terms. The reference category is 2.- obs_outcome
A vector containing the outcome variables of interest. There should be no
NA
terms.- X
A numeric design matrix for the true mediator mechanism.
- Z
A numeric design matrix for the observation mechanism.
- c_matrix
A numeric matrix of covariates in the true mediator and outcome mechanisms.
c_matrix
should not contain an intercept and no values should beNA
.- sample_size
An integer value specifying the number of observations in the sample. This value should be equal to the number of rows of the design matrix,
X
orZ
.- n_cat
The number of categorical values that the true outcome,
M
, and the observed outcome,M*
can take.