Skip to contents

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

Usage

pitilde_compute(delta, V, n, n_cat)

Arguments

delta

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

V

A numeric design matrix.

n

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, V.

n_cat

The number of categorical values that the true outcome, Y, and the observed outcomes can take.

Value

pitilde_compute returns an array of conditional probabilities, \(P(\tilde{Y}_i = \ell | Y^*_i = k, Y_i = j, V_i) = \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. Rows of the matrix correspond to each subject and second-stage observed outcome. Specifically, the probability for subject \(i\) and observed category $1$ occurs at row \(i\). The probability for subject \(i\) and observed category $2$ occurs at row \(i +\) n. Columns of the matrix correspond to the first-stage outcome categories, \(k = 1, \dots,\) n_cat. The third dimension of the array corresponds to the true outcome categories, \(j = 1, \dots,\) n_cat.