MULTINOMIAL
LOGIT MODEL
Nguyen Quang
quangn@ueh.edu.vn
Multinomial
response
MULTINOMIAL
RESPONSES
• logit/probit model: dependent variable = 0/1
• What if there are more than 2 categories?
• Example: long term effect of the exposure to
radiation may be
• 1 – dead of cancer
• 2 – dead of causes other than cancer
• 3 – alive
MULTINOMIAL
RESPONSES
• Other examples:
• Choice of a car brand (e.g., Toyota, Honda, Suzuki, Mazda, KIA)
• Choice of a university to apply to
• Choice of a university major/specialization
• Choice of a profession/career path
• We can’t use OLS or Logit/Probit. Why?
The multinomial
logit model
MULTINOMIAL LOGIT
MODEL
• Multinomial logit model (MNL) is used to analyze
the relationship between categorical variables and
other explanatory variables
• Note the difference:
• nominal response (MNL)
• ordinal response (ordered probit model – not
covered in this lecture)
THE DEPENDENT VARIABLE
• The occurrence of an alternative ๐ for individual ๐
๐๐ = 1,2,3, . . . , ๐ฝ
• Probability of occurrence of each alternative
Pr ๐๐ = 1 = ๐๐1
Pr(๐๐ = 2) = ๐๐2
…
Pr(๐๐ = ๐ฝ) = ๐๐๐ฝ
• The log-odds (logit) of each alternative
relative to a reference category (J):
โ๐1 = log
โ๐2 = log
๐๐1
๐๐๐ฝ
๐๐2
๐๐๐ฝ
, for ๐๐ = 1
, for ๐๐ = 2
…
โ๐๐ฝ = 0, for ๐๐ = ๐ฝ
THE LOGIT
(LOG-ODDS RATIO)
MODELLING THE LOGITS
For a categorical outcome ๐๐ with ๐ฝ possible choices, the logit (log-odds)
for each alternative relative to the reference category (๐ฝ) is modeled as:
• For ๐๐ = 1: โ๐1 = log
๐๐1
• For ๐๐ = 2: โ๐2 = log
๐๐2
…
• For ๐๐ = ๐ฝ:
๐๐๐ฝ
๐๐๐ฝ
= ๐๐ ๐ฝ1
= ๐๐ ๐ฝ2
โ๐๐ฝ = 0
For ๐ฝ alternatives, there will be (๐ฝ − 1) sets of estimated coefficients ๐ฝ.
THE PROBABILITIES
The probability of selecting each alternative is given by:
• For ๐๐ = 1, the probability is ๐๐1 =
• For ๐๐ = 2, the probability is ๐๐2 =
๐ ๐๐ ๐ฝ1
σ๐ฝ๐=1 ๐ ๐๐ ๐ฝ๐
๐ ๐๐ ๐ฝ2
σ๐ฝ๐=1 ๐ ๐๐ ๐ฝ๐
• …
• For ๐๐ = ๐ฝ, the probability is ๐๐๐ฝ =
๐ ๐ฝ
๐ ๐ ๐ฝ
σ๐ฝ๐=1 ๐ ๐๐ ๐ฝ๐
These probabilities ensure that the sum across all ๐ฝ alternatives equals 1.
MAXIMUM LIKELIHOOD ESTIMATION
• The Multinomial Logit (MNL) model is estimated by maximizing the loglikelihood function:
๐
๐ฝ
log ๐ฟ = เท เท ๐ฆ๐๐ ln ๐๐๐
๐=1 ๐=1
• The indicator variable ๐๐๐ is defined as:
• ๐๐๐ = 0, if alternative ๐ is NOT chosen by individual ๐
• ๐๐๐ = 1, if alternative ๐ is chosen by individual ๐
Example data
Vhlss 2012
• Dependent variable: choice of health care provider
• 1 = Commune health center
• 2 = Public hospital
• 3 = Private hospital
• 4 = Lang y
• 5 = Individual health care provider
• insurance: 1 = having insurance, 0 otherwise
• household income: mil. VND/year
• female: 1 = female, 0 otherwise
• age (years)
• edu: 0 = under primary, 1 = primary, 2 = secondary, 3 =
high school, 4 = college or higher.
• urban: 1 = living in urban area
• Data file: mnl.xlsx
Data
id
case
choice
income
female
1
1
2
12
1
1
2
4
12
1
2
1
3
21
1
3
1
17
0
3
2
17
0
3
3
17
0
…
…
• choice: 1 = Commune health center; 2 = Public hospital; 3 = Private
hospital; 4 = Lang y; 5 = Individual health care provider
• income: mil. VND/year
• female: 1 = female, 0 otherwise
DESCRIPTIVE
STATISTICS
THE DEPENDENT
VARIABLE
CATEGORICAL
VARIABLES IN THE
DATASET
R FUNCTION FOR TWO-WAY TABLE
BIVARIATE
ANALYSIS
BIVARIATE ANALYSIS
MNL model in
RStudio
SET THE BASE OUTCOME
THE MNL MODEL (COEF)
THE MNL MODEL (SE)
THE MNL MODEL (Z)
THE MNL MODEL (P-VALUE)
Separate
equations
Separate
equations
LR TEST FOR OVERALL SIGNIFICANCE
HYPOTHESIS TESTING
AFTER MNL
THE FITTED VALUES
THE PREDICTION
MCFADDEN R-SQUARE
MARGINAL EFFECTS
MARGINAL EFFECTS
MARGINAL EFFECTS