misclassification_prob2 {COMBO}R Documentation

Compute Conditional Probability of Each Second-Stage Observed Outcome Given Each True Outcome and First-Stage Observed Outcome, for Every Subject

Description

Compute the conditional probability of observing second-stage outcome \tilde{Y} \in \{1, 2 \} given the latent true outcome Y \in \{1, 2 \} and the first-stage outcome Y^* \in \{1, 2\} as \frac{\text{exp}\{\delta_{\ell kj0} + \delta_{\ell kjV} V_i\}}{1 + \text{exp}\{\delta_{\ell kj0} + \delta_{\ell kjV} V_i\}} for each of the i = 1, \dots, n subjects.

Usage

misclassification_prob2(delta_array, v_matrix)

Arguments

delta_array

A numeric array of estimated regression parameters for the observation mechanism, \tilde{Y} | Y*, Y (second-stage observed outcome, given the first-stage observed outcome and the true outcome) ~ V (second-stage misclassification predictor matrix). Rows of the array correspond to parameters for the \tilde{Y} = 1 observed outcome, with the dimensions of v_matrix. Columns of the array correspond to the first-stage outcome categories k = 1, \dots, n_cat. The third stage of the array corresponds to the true outcome categories j = 1, \dots, n_cat. The array should be obtained by COMBO_EM or COMBO_MCMC.

v_matrix

A numeric matrix of covariates in the second-stage observation mechanism. v_matrix should not contain an intercept.

Value

misclassification_prob2 returns a dataframe containing five columns. The first column, Subject, represents the subject ID, from 1 to n, where n is the sample size, or equivalently, the number of rows in v_matrix. The second column, Y, represents a true, latent outcome category Y \in \{1, 2 \}. The third column, Ystar, represents a first-stage observed outcome category Y^* \in \{1, 2 \}. The fourth column, Ytilde, represents a second-stage observed outcome category \tilde{Y} \in \{1, 2 \}. The last column, Probability, is the value of the equation \frac{\text{exp}\{\delta_{\ell kj0} + \delta_{\ell kjV} V_i\}}{1 + \text{exp}\{\delta_{\ell kj0} + \delta_{\ell kjV} V_i\}} computed for each subject, first-stage observed outcome category, second-stage observed outcome category, and true, latent outcome category.

Examples

set.seed(123)
sample_size <- 1000
cov1 <- rnorm(sample_size)
cov2 <- rnorm(sample_size, 1, 2)
v_matrix <- matrix(c(cov1, cov2), nrow = sample_size, byrow = FALSE)
estimated_deltas <- array(c(1, -1, .5, .2, -.6, 1.5,
                            -1, .5, -1, -.5, -1, -.5), dim = c(3,2,2))
P_Ytilde_Ystar_Y <- misclassification_prob2(estimated_deltas, v_matrix)
head(P_Ytilde_Ystar_Y)

[Package COMBO version 1.0.0 Index]