View source: R/generate_multinom_probs.R
generate_multinom_probs | R Documentation |
Obtain probabilities for each category of a multinomial distribution based on covariate and parameter values based on the logit models for the multinomial distribution.
generate_multinom_probs(V = NULL, B = NULL, X = NULL, X.incl.X0 = FALSE)
V |
A numeric value stating the number of categories desired. |
B |
A list, each element of which contains a parameter vector. The
list should have length |
X |
A matrix, each row of which contains subject covariate/predictor values. |
X.incl.X0 |
Logical. When |
A matrix containing subject-specific probabilities for each
category of the multinomial distribution. The number of rows equals
nrow(X)
and the number of columns equals V
.
Agresti:2007sim2Dpredictr
\insertRefFriedman:2010sim2Dpredictr
## number of categories
vt <- 3
## covariate values
xt <- matrix(rnorm(10 * 2), ncol = 2, nrow = 10)
## list of parameter vectors
bt <- list(b1 = c(1, 0.25, -0.25),
b2 = c(-0.5, 0.15, 0.15))
## list of parameter vectors (over-parameterized model)
bu <- list(b1 = c(1, 0.25, -0.25),
b2 = c(-0.5, 0.15, 0.15),
b3 = c(-1, 0.1, -0.20))
## subject specific probabilities for each category
generate_multinom_probs(V = vt, X = xt, B = bt)
## subject specific probabilities for each category
## (over-parameterized model)
generate_multinom_probs(V = vt, X = xt, B = bu)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.