true_classification_prob {COMBO} | R Documentation |
Compute Probability of Each True Outcome, for Every Subject
Description
Compute the probability of the latent true outcome as
for each of the
n
subjects.
Usage
true_classification_prob(beta_matrix, x_matrix)
Arguments
beta_matrix |
A numeric column matrix of estimated regression parameters for the
true outcome mechanism, |
x_matrix |
A numeric matrix of covariates in the true outcome mechanism.
|
Value
true_classification_prob
returns a dataframe containing three columns.
The first column, Subject
, represents the subject ID, from to
n
,
where n
is the sample size, or equivalently, the number of rows in x_matrix
.
The second column, Y
, represents a true, latent outcome category .
The last column,
Probability
, is the value of the equation
computed
for each subject and true, latent outcome category.
Examples
set.seed(123)
sample_size <- 1000
cov1 <- rnorm(sample_size)
cov2 <- rnorm(sample_size, 1, 2)
x_matrix <- matrix(c(cov1, cov2), nrow = sample_size, byrow = FALSE)
estimated_betas <- matrix(c(1, -1, .5), ncol = 1)
P_Y <- true_classification_prob(estimated_betas, x_matrix)
head(P_Y)