Compute Probability of Each True Outcome, for Every Subject
Compute Probability of Each True Outcome, for Every Subject
pi_compute(beta, X, n, n_cat)
Arguments
beta: A numeric column matrix of regression parameters for the Y (true outcome) ~ X (predictor matrix of interest).
X: 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, X.
n_cat: The number of categorical values that the true outcome, Y, can take.
Returns
pi_compute returns a matrix of probabilities, P(Yi=j∣Xi)=1+exp(Xiβ)exp(Xiβ)
for each of the i=1,…,n subjects. Rows of the matrix correspond to each subject. Columns of the matrix correspond to the true outcome categories j=1,…,n_cat.