loglik_2stage {COMBO}  R Documentation 
Expected Complete Data LogLikelihood Function for Estimation of the TwoStage Misclassification Model
Description
Expected Complete Data LogLikelihood Function for Estimation of the TwoStage Misclassification Model
Usage
loglik_2stage(
param_current,
obs_Ystar_matrix,
obs_Ytilde_matrix,
X,
Z,
V,
sample_size,
n_cat
)
Arguments
param_current 
A numeric vector of regression parameters, in the order

obs_Ystar_matrix 
A numeric matrix of indicator variables (0, 1) for the firststage observed
outcome 
obs_Ytilde_matrix 
A numeric matrix of indicator variables (0, 1) for the secondstage observed
outcome 
X 
A numeric design matrix for the true outcome mechanism. 
Z 
A numeric design matrix for the firststage observation mechanism. 
V 
A numeric design matrix for the secondstage observation mechanism. 
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 matrices, 
n_cat 
The number of categorical values that the true outcome, 
Value
loglik_2stage
returns the negative value of the expected loglikelihood function,
Q = \sum_{i = 1}^N \Bigl[ \sum_{j = 1}^2 w_{ij} \text{log} \{ \pi_{ij} \} + \sum_{j = 1}^2 \sum_{k = 1}^2 w_{ij} y^*_{ik} \text{log} \{ \pi^*_{ikj} \} +
\sum_{j = 1}^2 \sum_{k = 1}^2 \sum_{\ell = 1}^2 w_{ij} y^*_{ik} \tilde{y}_{i \ell} \text{log} \{ \tilde{\pi}_{i \ell kj} \}\Bigr]
,
at the provided inputs.