TravelMode | R Documentation |
Data on travel mode choice for travel between Sydney and Melbourne, Australia.
data("TravelMode")
A data frame containing 840 observations on 4 modes for 210 individuals.
Factor indicating individual with levels 1
to 210
.
Factor indicating travel mode with levels
"car"
, "air"
, "train"
, or "bus"
.
Factor indicating choice with levels "no"
and "yes"
.
Terminal waiting time, 0 for car.
Vehicle cost component.
Travel time in the vehicle.
Generalized cost measure.
Household income.
Party size.
Online complements to Greene (2003).
https://pages.stern.nyu.edu/~wgreene/Text/tables/tablelist5.htm
Greene, W.H. (2003). Econometric Analysis, 5th edition. Upper Saddle River, NJ: Prentice Hall.
Greene2003
data("TravelMode", package = "AER")
## overall proportions for chosen mode
with(TravelMode, prop.table(table(mode[choice == "yes"])))
## travel vs. waiting time for different travel modes
library("lattice")
xyplot(travel ~ wait | mode, data = TravelMode)
## Greene (2003), Table 21.11, conditional logit model
library("mlogit")
TravelMode$incair <- with(TravelMode, income * (mode == "air"))
tm_cl <- mlogit(choice ~ gcost + wait + incair, data = TravelMode,
shape = "long", alt.var = "mode", reflevel = "car")
summary(tm_cl)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.