pi_compute function

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=jXi)=exp(Xiβ)1+exp(Xiβ)P(Y_i = j | X_i) = \frac{\exp(X_i \beta)}{1 + \exp(X_i \beta)}

for each of the i=1,,i = 1, \dots, n subjects. Rows of the matrix correspond to each subject. Columns of the matrix correspond to the true outcome categories j=1,,j = 1, \dots, n_cat.

  • Maintainer: Kimberly Webb
  • License: MIT + file LICENSE
  • Last published: 2024-12-13

Useful links