w_m_normalY {COMMA} | R Documentation |
Compute E-step for Binary Mediator Misclassification Model Estimated With the EM Algorithm
Description
Note that this function should only be used for Normal outcome models.
Usage
w_m_normalY(
mstar_matrix,
pistar_matrix,
pi_matrix,
p_yi_m0,
p_yi_m1,
sample_size,
n_cat
)
Arguments
mstar_matrix |
A numeric matrix of indicator variables (0, 1) for the observed
mediator |
pistar_matrix |
A numeric matrix of conditional probabilities obtained from
the internal function |
pi_matrix |
A numeric matrix of probabilities obtained from the internal
function |
p_yi_m0 |
A numeric vector of Normal outcome likelihoods computed assuming a true mediator value of 0. |
p_yi_m1 |
A numeric vector of Normal outcome likelihoods computed assuming a true mediator value of 1. |
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 observed
mediator matrix, |
n_cat |
The number of categorical values that the true outcome, |
Value
w_m_normalY
returns a matrix of E-step weights for the EM-algorithm.
Rows of the matrix correspond to each subject. Columns of the matrix correspond
to the true mediator categories j = 1, \dots,
n_cat
.