16.2 Multinomial Logit and Multinomial Probit Models
Revealed preferences:
- Observed choices of individuals
Stated preference
- Hypothetical choice situations
Economists’ modeling of choice
- Utility/happiness/satisfaction associated with multiple choice situations
16.2.1 Theoretical Aspects
Travel choice model dependent on cost (\(x\)) and time (\(z\)): \[V_j = \alpha_j + \beta_1 \cdot x_j + \beta_2 \cdot z_j\] Probability of choosing alternative \(j\) (assuming three choices): \[ \begin{aligned} P(1) &= \frac{e^{V_1}}{e^{V_1}+e^{V_2}+e^{V_3}}\\ P(2) &= \frac{e^{V_2}}{e^{V_1}+e^{V_2}+e^{V_3}}\\ P(3) &= \frac{e^{V_3}}{e^{V_1}+e^{V_2}+e^{V_3}} \end{aligned} \]
Note that \(P(1)+P(2)+P(3) = 1\)
16.2.2 Data Managment
Long shape
- One row for each alternative
Wide shape
- One row for each choice situation
There are some very good resources on data management and the package in general:
Travel Mode (long format)
- Travel Mode Choice Data
mlogit.data(travelmode,choice="choice",shape="long",alt.levels=c("air","train","bus","car"))
16.2.3 Fishing Data
The data is in wide format:
- Fishing modes: beach, pier, private, and charter
- Alternative-specific variables: price and catch
- Individual-specific variables: income
- Suitability of the “wide” format to store individual-specific variables
- The R parameter
varying
designates alternative specific variables
In a first step, the model is only estimated using the individual-specific variable \(income\):
data("Fishing",package="mlogit")
fishing = mlogit.data(Fishing,shape="wide",varying=2:9,choice="mode")
bhat = mlogit(mode~0|income,fishing)
summary(bhat)
##
## Call:
## mlogit(formula = mode ~ 0 | income, data = fishing, method = "nr")
##
## Frequencies of alternatives:choice
## beach boat charter pier
## 0.11337 0.35364 0.38240 0.15059
##
## nr method
## 4 iterations, 0h:0m:0s
## g'(-H)^-1g = 8.32E-07
## gradient close to zero
##
## Coefficients :
## Estimate Std. Error z-value Pr(>|z|)
## (Intercept):boat 7.3892e-01 1.9673e-01 3.7560 0.0001727 ***
## (Intercept):charter 1.3413e+00 1.9452e-01 6.8955 5.367e-12 ***
## (Intercept):pier 8.1415e-01 2.2863e-01 3.5610 0.0003695 ***
## income:boat 9.1906e-05 4.0664e-05 2.2602 0.0238116 *
## income:charter -3.1640e-05 4.1846e-05 -0.7561 0.4495908
## income:pier -1.4340e-04 5.3288e-05 -2.6911 0.0071223 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Log-Likelihood: -1477.2
## McFadden R^2: 0.013736
## Likelihood ratio test : chisq = 41.145 (p.value = 6.0931e-09)
## beach boat charter pier
## 7.496226e-08 3.259851e-05 -1.201366e-05 -2.065981e-05
In a second step, alternative-specific variables are added:
##
## Call:
## mlogit(formula = mode ~ catch + price | income, data = fishing,
## method = "nr")
##
## Frequencies of alternatives:choice
## beach boat charter pier
## 0.11337 0.35364 0.38240 0.15059
##
## nr method
## 7 iterations, 0h:0m:0s
## g'(-H)^-1g = 1.37E-05
## successive function values within tolerance limits
##
## Coefficients :
## Estimate Std. Error z-value Pr(>|z|)
## (Intercept):boat 5.2728e-01 2.2279e-01 2.3667 0.0179485 *
## (Intercept):charter 1.6944e+00 2.2405e-01 7.5624 3.952e-14 ***
## (Intercept):pier 7.7796e-01 2.2049e-01 3.5283 0.0004183 ***
## catch 3.5778e-01 1.0977e-01 3.2593 0.0011170 **
## price -2.5117e-02 1.7317e-03 -14.5042 < 2.2e-16 ***
## income:boat 8.9440e-05 5.0067e-05 1.7864 0.0740345 .
## income:charter -3.3292e-05 5.0341e-05 -0.6613 0.5084031
## income:pier -1.2758e-04 5.0640e-05 -2.5193 0.0117582 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Log-Likelihood: -1215.1
## McFadden R^2: 0.18868
## Likelihood ratio test : chisq = 565.17 (p.value = < 2.22e-16)
## beach boat charter pier
## -7.214167e-07 3.176132e-05 -2.173392e-05 -9.305980e-06
The mlogit
package also allows for the estimation of a multinomial probit model.
##
## Call:
## mlogit(formula = mode ~ catch + price | income, data = fishing,
## probit = FALSE, method = "nr")
##
## Frequencies of alternatives:choice
## beach boat charter pier
## 0.11337 0.35364 0.38240 0.15059
##
## nr method
## 7 iterations, 0h:0m:0s
## g'(-H)^-1g = 1.37E-05
## successive function values within tolerance limits
##
## Coefficients :
## Estimate Std. Error z-value Pr(>|z|)
## (Intercept):boat 5.2728e-01 2.2279e-01 2.3667 0.0179485 *
## (Intercept):charter 1.6944e+00 2.2405e-01 7.5624 3.952e-14 ***
## (Intercept):pier 7.7796e-01 2.2049e-01 3.5283 0.0004183 ***
## catch 3.5778e-01 1.0977e-01 3.2593 0.0011170 **
## price -2.5117e-02 1.7317e-03 -14.5042 < 2.2e-16 ***
## income:boat 8.9440e-05 5.0067e-05 1.7864 0.0740345 .
## income:charter -3.3292e-05 5.0341e-05 -0.6613 0.5084031
## income:pier -1.2758e-04 5.0640e-05 -2.5193 0.0117582 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Log-Likelihood: -1215.1
## McFadden R^2: 0.18868
## Likelihood ratio test : chisq = 565.17 (p.value = < 2.22e-16)
## beach boat charter pier
## -7.214167e-07 3.176132e-05 -2.173392e-05 -9.305980e-06
## Warning in rm(bhat, Fishing, fishing, fishing.fitted): object 'Fishing' not found
16.2.4 Travel Data
data("TravelMode",package="AER")
travelmode = mlogit.data(TravelMode,choice="choice",shape="long",alt.var="mode")
bhat = mlogit(choice~gcost+wait|income+size,data=travelmode,reflevel="car")
summary(bhat)
##
## Call:
## mlogit(formula = choice ~ gcost + wait | income + size, data = travelmode,
## reflevel = "car", method = "nr")
##
## Frequencies of alternatives:choice
## car air train bus
## 0.28095 0.27619 0.30000 0.14286
##
## nr method
## 5 iterations, 0h:0m:0s
## g'(-H)^-1g = 1.66E-07
## gradient close to zero
##
## Coefficients :
## Estimate Std. Error z-value Pr(>|z|)
## (Intercept):air 7.8736084 0.9868475 7.9785 1.554e-15 ***
## (Intercept):train 5.5592051 0.6991387 7.9515 1.776e-15 ***
## (Intercept):bus 4.4331916 0.7783339 5.6957 1.228e-08 ***
## gcost -0.0196850 0.0054015 -3.6444 0.0002680 ***
## wait -0.1015659 0.0112306 -9.0436 < 2.2e-16 ***
## income:air 0.0040710 0.0127247 0.3199 0.7490196
## income:train -0.0551849 0.0144824 -3.8105 0.0001387 ***
## income:bus -0.0233237 0.0162973 -1.4311 0.1523914
## size:air -1.0274229 0.2656569 -3.8675 0.0001100 ***
## size:train 0.3023954 0.2256155 1.3403 0.1801437
## size:bus -0.0300096 0.3339774 -0.0899 0.9284023
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Log-Likelihood: -177.45
## McFadden R^2: 0.37463
## Likelihood ratio test : chisq = 212.61 (p.value = < 2.22e-16)
16.2.5 Electric Vehicle Data
evdata = mlogit.data(evdata,shape="wide",choice="choice")
bhat = mlogit(choice~0|age+female+level2+numcars+edu+income+politics,data=evdata)
summary(bhat)
##
## Call:
## mlogit(formula = choice ~ 0 | age + female + level2 + numcars +
## edu + income + politics, data = evdata, method = "nr")
##
## Frequencies of alternatives:choice
## 1 2 3 4
## 0.419355 0.265233 0.225806 0.089606
##
## nr method
## 5 iterations, 0h:0m:0s
## g'(-H)^-1g = 0.000603
## successive function values within tolerance limits
##
## Coefficients :
## Estimate Std. Error z-value Pr(>|z|)
## (Intercept):2 0.11810109 0.60622429 0.1948 0.8455384
## (Intercept):3 0.90653782 0.63856959 1.4196 0.1557130
## (Intercept):4 0.34528552 0.84542368 0.4084 0.6829675
## age:2 -0.01298148 0.00731409 -1.7749 0.0759210 .
## age:3 -0.04216613 0.00867889 -4.8585 1.183e-06 ***
## age:4 -0.02314160 0.01139425 -2.0310 0.0422561 *
## female:2 0.17935742 0.21591603 0.8307 0.4061537
## female:3 -0.02781447 0.23732560 -0.1172 0.9067019
## female:4 0.00019196 0.32364088 0.0006 0.9995267
## level2:2 0.13808856 0.25338230 0.5450 0.5857665
## level2:3 0.87829370 0.25462065 3.4494 0.0005618 ***
## level2:4 1.14103750 0.33905869 3.3653 0.0007646 ***
## numcars:2 0.08340570 0.10845229 0.7691 0.4418611
## numcars:3 0.02412224 0.11385000 0.2119 0.8322027
## numcars:4 -0.35470532 0.15922101 -2.2278 0.0258969 *
## edu:2 0.09033371 0.08476675 1.0657 0.2865711
## edu:3 0.21765011 0.09487551 2.2941 0.0217871 *
## edu:4 -0.00475892 0.12980749 -0.0367 0.9707550
## income:2 -0.01070840 0.07000961 -0.1530 0.8784328
## income:3 -0.04329121 0.07768626 -0.5573 0.5773519
## income:4 -0.01112286 0.10371253 -0.1072 0.9145930
## politics:2 -0.15253774 0.05211226 -2.9271 0.0034214 **
## politics:3 -0.19656259 0.05687906 -3.4558 0.0005487 ***
## politics:4 -0.07567912 0.07405617 -1.0219 0.3068211
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Log-Likelihood: -663.51
## McFadden R^2: 0.062686
## Likelihood ratio test : chisq = 88.75 (p.value = 2.6494e-10)