forked from vincentarelbundock/Rdatasets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TravelMode.html
102 lines (73 loc) · 2.95 KB
/
TravelMode.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<!DOCTYPE html><html><head><title>R: Travel Mode Choice Data</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css">
<script type="text/javascript">
const macros = { "\\R": "\\textsf{R}", "\\code": "\\texttt"};
function processMathHTML() {
var l = document.getElementsByClassName('reqn');
for (let e of l) { katex.render(e.textContent, e, { throwOnError: false, macros }); }
return;
}</script>
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.js"
onload="processMathHTML();"></script>
<link rel="stylesheet" type="text/css" href="R.css" />
</head><body><div class="container">
<table style="width: 100%;"><tr><td>TravelMode</td><td style="text-align: right;">R Documentation</td></tr></table>
<h2>Travel Mode Choice Data</h2>
<h3>Description</h3>
<p>Data on travel mode choice for travel between Sydney and Melbourne, Australia.
</p>
<h3>Usage</h3>
<pre><code class='language-R'>data("TravelMode")</code></pre>
<h3>Format</h3>
<p>A data frame containing 840 observations on 4 modes for 210 individuals.
</p>
<dl>
<dt>individual</dt><dd><p>Factor indicating individual with levels <code>1</code> to <code>210</code>.</p>
</dd>
<dt>mode</dt><dd><p>Factor indicating travel mode with levels
<code>"car"</code>, <code>"air"</code>, <code>"train"</code>, or <code>"bus"</code>.</p>
</dd>
<dt>choice</dt><dd><p>Factor indicating choice with levels <code>"no"</code> and <code>"yes"</code>.</p>
</dd>
<dt>wait</dt><dd><p>Terminal waiting time, 0 for car.</p>
</dd>
<dt>vcost</dt><dd><p>Vehicle cost component.</p>
</dd>
<dt>travel</dt><dd><p>Travel time in the vehicle.</p>
</dd>
<dt>gcost</dt><dd><p>Generalized cost measure.</p>
</dd>
<dt>income</dt><dd><p>Household income.</p>
</dd>
<dt>size</dt><dd><p>Party size.</p>
</dd>
</dl>
<h3>Source</h3>
<p>Online complements to Greene (2003).
</p>
<p><a href="https://pages.stern.nyu.edu/~wgreene/Text/tables/tablelist5.htm">https://pages.stern.nyu.edu/~wgreene/Text/tables/tablelist5.htm</a>
</p>
<h3>References</h3>
<p>Greene, W.H. (2003). <em>Econometric Analysis</em>, 5th edition. Upper Saddle River, NJ: Prentice Hall.
</p>
<h3>See Also</h3>
<p><code>Greene2003</code></p>
<h3>Examples</h3>
<pre><code class='language-R'>
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)
</code></pre>
</div>
</body></html>