Learn R Programming

hesim (version 0.5.0)

params_mlogit: Parameters of a multinomial logit model

Description

Store the parameters of a fitted multinomial logistic regression model. The model is used to predict probabilities of \(K\) classes.

Usage

params_mlogit(coefs)

Arguments

coefs

A 3D array of stacked matrices. The number of matrices (i.e., the number of slices in the cube) should be equal to \(K-1\). Each matrix is contains samples of the regression coefficients under sampling uncertainty corresponding to a particular class. Rows index parameter samples and columns index coefficients.

Value

An object of class params_mlogit, which is a list containing coefs and n_samples, where n_samples is equal to the number of rows in each element of coefs.

Details

Multinomial logit models are used to predict the probability of membership for subject \(i\) in each of \(K\) classes as a function of covariates: $$Pr(y_i = c) = \frac{e^{\beta_c x_i}}{\sum_{k=1}^K e^{\beta_k x_i}}$$

Examples

Run this code
# NOT RUN {
params <- params_mlogit(coefs = array(
  c(matrix(c(intercept = 0, treatment = log(.75)), nrow = 1),
    matrix(c(intercept = 0, treatment = log(.8)), nrow = 1)),
  dim = c(1, 2, 2)
)) 
# }

Run the code above in your browser using DataLab