Lab 4
CEGE 3201
Chimdi Onyiuke
1. Understand data sets
a) There are 4 choice decisions.
b) There are 2 traffic modes, car and carpool.
c) There are 4 types of cost.
d) There are 1000 individual cases and they have 2 choices, 1 or 0.
e) There are 4 alternatives, train, air, bus and car.
f) I think cost, ivt, ovt, frequency and income have impacts on the decision makers’ choice. Cost,
ivt, ovt, frequency and income represent monetary cost, in vehicule time, out vehicule time,
frequency of modes, and decision makers’ income respectively.
2. Build and interpret logit models
a)
Coefficient Estimate p-value
Air: (intercept) 1.73538334 1.241e-08 ***
Bus: (intercept) -3.97122998 <2.2e-16 ***
Car: (intercept) -1.06134201 4.489e-12 ***
Cost -0.03113234 < 2.2e-16 ***
IVT -0.01520282 < 2.2e-16 ***
OVT -0.03196454 < 2.2e-16 ***
Log-Likelihood -3068.5
R-Command m1 <- mlogit(formula = choice ~ cost + ivt + ovt, data =
ModeCanadaData)
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
The estimated coefficients are proportionally related to the utility, so if the coefficients become
more negative, the utility will become more negative reducing the probablility.
b)
Coefficient Estimate p-value
Air: (intercept) -2.82892163 1.136e-09 ***
Bus: (intercept) -1.45073160 0.0191639 *
Car: (intercept) 0.23332511 0.2001779
Cost 0.01813597 0.0003551 ***
IVT -0.00937668 8.882e-16 ***
OVT -0.04045488 < 2.2e-16 ***
Air: dist 0.00178952 0.0199868 *
Bus: dist -0.00579724 0.0278606 *
Car: dist -0.00833380 < 2.2e-16 ***
Log-Likelihood -2875.7
R-Command m2 <- mlogit(formula = choice ~ cost + ivt + ovt|dist, data =
ModeCanadaData)
Calculating probabilities of using each mode:
Calculate the utility for each mode using these functions
v_air <- (m2$coefficients[1] + 163.10* m2$coefficients[4] + 58* m2$coefficients[5] + 98*
m2$coefficients[6] + 417* m2$coefficients[7]) = -3.633142
v_bus <- (m2$coefficients[2] + 32.27* m2$coefficients[4] + 290* m2$coefficients[5] + 77*
m2$coefficients[6] + 417* m2$coefficients[8]) = -9.117196
v_car <- (m2$coefficients[3] + 79.23* m2$coefficients[4] + 278* m2$coefficients[5] + 0*
m2$coefficients[6] + 417* m2$coefficients[9]) = -4.411676
v_train <- (62.55* m2$coefficients[4] + 263* m2$coefficients[5] + 74* m2$coefficients[6]) =
-4.325323
Calculate the probabilities of using each mode
p_air<- as.numeric(exp(v_air)/(exp(v_air) + exp(v_bus) + exp(v_car) + exp(v_train))) =
0.5092392
p_bus<- as.numeric(exp(v_bus)/(exp(v_air) + exp(v_bus) + exp(v_car) + exp(v_train))) =
0.002114595
p_car<- as.numeric(exp(v_car)/(exp(v_air) + exp(v_bus) + exp(v_car) + exp(v_train))) =
0.2337807
p_train<- as.numeric(exp(v_train)/(exp(v_air) + exp(v_bus) + exp(v_car) + exp(v_train))) =
0.2548655
c)
Coefficient Estimate p-value
Air: (intercept) -3.86564744 7.47e-11 ***
Bus: (intercept) -2.58297555 0.0025321 **
Car: (intercept) -0.42881687 0.0840426 .
Cost 0.02301445 0.0006089 ***
IVT -0.01036296 2.66e-09 ***
OVT -0.04607599 < 2.2e-16 ***
Air: dist 0.00286941 0.0117797 *
Bus: dist -0.00211674 0.4783469
Car: dist -0.00821252 < 2.2e-16 ***
Log-Likelihood -2080.1
R-Command m3 <- mlogit(formula = choice ~ cost + ivt + ovt|dist, data =
ModeCanadaData, subset = noalt == 4)
These are the utility functions:
Vair = -3.866 − 0.0230Cost – 0.0104IVT – 0.0461OVT + 0.003Dist
Vbus = -3.866 − 0.0230Cost – 0.0104IVT – 0.0461OVT – 0.002Dist
Vcar = -3.866 − 0.0230Cost – 0.0104IVT – 0.0461OVT – 0.008Dist
Vtrain = − 0.0230Cost – 0.0104IVT – 0.0461OVT