-
Notifications
You must be signed in to change notification settings - Fork 0
/
how-to.html
238 lines (238 loc) · 8.65 KB
/
how-to.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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
<!DOCTYPE HTML>
<meta charset="utf-8">
<title>How to use this site</title>
<link rel="stylesheet" type="text/css" href="styles/how-to.css">
<link href="https://fonts.googleapis.com/css?family=Abril+Fatface|Playfair+Display|Raleway|Old+Standard+TT|Open+Sans|Crimson+Text" rel="stylesheet">
<body>
<div id="title">
<h1>How to use this site:</h1>
</div>
<div id="content">
<div class="par">
This page explains how to navigate and use the features of the Exploring
Opportunity site that visualized the Equality of Opportunity data from
the Chetty et al. (2014) study identifying the causal effects of
geography on social mobility.
</div>
<div class="par">
This site was developed and tested using Chromium Browser (Google
Chrome). If something looks or acts a bit off, it might be because of your browser.
</div>
<div>
<h3>Jump to:</h3>
<ul class="nav">
<li class="nav">
<a href="#vars">Variable Definitions</a>
</li>
<li class="nav">
<a href="#nav">Navigation</a>
<ul>
<li class="nav"><a href="#zoom">Zoom</a></li>
</ul>
</li>
<li class="nav"><a href="#data">Using your own data</a></li>
<li class="nav"><a href="#reg">Regression table</a></li>
<li class="nav"><a href="#plot">Plotting</a></li>
</ul>
</div>
<h2 id="vars">Variable Definitions</h2>
<div class="par">
There are a lot of variables and abbreviations. Here’s the
<a href="http://www.equality-of-opportunity.org/data/neighborhoods/online_table4.pdf" target="_blank">documentation</a> with all the definitions and the naming scheme.
</div>
<h2 id="nav">Navigation:</h2>
<div class="par">
Each of the option side-bars can be closed and opened
by clicking on the light gray bars like the one below:
</div>
<div class="bar"></div>
<h3 id="zoom">Zoom:</h3>
<div class="par">
Click to zoom and center on a geographic-level. To get a closer look,
click on a smaller region; the map scales proportionally to its area.
You can recenter the map by clicking the same location twice or by
clicking on the background of the map.
</div>
<h2 id="data">Using your own data:</h2>
<div class="par">
This site allows you upload and merge data to the EO dataset.
These files will not be saved. To prevent data loss, I suggest
saving all of you data
(at the very least the geographic identifiers) that you intend to use
as UTF-8 encoded character strings before attempting to load it.
</div>
<div class="par">
Variable names in you dataset and the EO dataset can’t be the same,
or the EO data will be overwritten.
</div>
<div class="par note" id="null">
<h4>Note on <span class="mono">null</span> types:</h4>
Variables should not be stored as <span class="mono">null</span>
unless you expect them to be treated as zeros or if they are stored as a
character string and you expect them to treated as missing values.
Variables in this form have not been rigorously tested; you may
risk data loss and failed or incorrect merges.
</div>
<ol>
<li>
<div class="par">
Click the light gray bar at the top of the page, above
the map—a dropdown box will open.
<br/>
<img src="styles/imgs/use-data.png" style="width:370px">
</div>
</li>
<li>
<div class="par">
Click <div class="bttn">Choose a <span class="mono">.csv</span></div>
A dialog box will open. Choose the file you want upload.
</div>
</li>
<li>
<div class="par">
Once the file is successfully opened, the rest of the menu
will be become active. Click the dropdown box above the Information
box. Choose the variable in your dataset that will match to the EO
dataset based on geographic location.
This geographic identifier must be a concatenation of the 2000
two-digit state FIPS and three-digit county FIPS codes with
leading zeros.
For more information on FIPS codes see the <a href="https://usa.ipums.org/usa-action/variables/COUNTYFIPS#description_section" target="_blank">IPUMS description</a>.
</div>
<div class="par">
If you are loading data with missing geographic identifirs, they
should be stored as <span class="mono">NA</span> or
<span class="mono">NaN</span> (see <a href="#null">note</a> on
<span class="mono">null</span> values).
</div>
</li>
<li>
<div class="par">
Once your data is uploaded, you will see information about the
success of the merge.
</div>
<div class="par">
There are two ways for your merge to partially
or completely fail: your data contains geographic identifiers not
found in the EO data or vice versa.
</div>
<div class="par">
If the merge partially (or completely) failed, you can download a
<span class="mono">.json</span> file that contains the unmatched
observations from your dataset and some information about the
unmatched observations from the EO dataset. A generalized example
of the file structure is below:
<div class="code">
{<br/>
unmatched_cli:<br/>
 [{var1: observation1, var2: observation1, ... varK: observation1},<br/>
 {var1: observation2, var2: observation2, ... varK: observation2},<br/>
 ...,<br/>
 {var1: observationN, var2: observationN, ... varK: observationN}],<br/>
unmatched_serv:<br/>
 [{GEOID: observation1, ST: observation1, COUNTY: observation1},<br/>
 {GEOID: observation2, ST: observation2, COUNTY: observation2},<br/>
 ...,<br/>
 {GEOID: observationN, ST: observationN, COUNTY: observationN}]<br/>
}
</div>
</div>
</li>
<li>
<div class="par">
If your merge was partially (or completely) successful,
you’ll be able to export the data as a
<span class="mono">.csv</span>
</div>
</li>
</ol>
<div class="par">
You will now be able to use any of the mapping, plotting, regression
table, and monotonic transformation features on your data.
</div>
<div class="par">
Multiple datasets can be opened and merged as long as they don’t
have the same variable names of those in the EO data or your previously
loaded files.
</div>
<h2 id="reg">Regression Table:</h2>
<div class="par">
You can run an multi-variate Ordinary Least-Squares regression using the
EO dataset or any data you may have uploaded.
</div>
<ol>
<li>
<div class="par">
Click the light gray box next to the left of the plot; a box will
open with options for a regression specification.
<br/>
<img src="styles/imgs/show-reg.png" style="height:150px;width:300px">
</div>
</li>
<li>
<div class="par">
Select an outcome as the left-hand-side variable of the
regression you’d like to run and select any number of
right-hand-side variables from the available covariates.
</div>
<div class="par">
If you successfully uploaded any data you should see those variables
at the top of each list.
</div>
</li>
<li>
<div class="par">
Click <div class="bttn">Run!</div> and a table of regression
coefficients, standard errors, number of observations, R², and
F-test will load to the right of plot if your specification
wasn’t malformed.
</div>
</ol>
<div class="par note">
<h4>Note on p-values:</h4>
P-values and stars are not currently supported. You’ll have to
pay close attention to the value of the coefficient and the size of
the standard error.
</div>
<h2 id="plot">Plotting:</h2>
<div class="par">
This site a scatter plot feature. As default, the dependant variable is
grouped into 64 bins. The mean value of the dependant and independent
variable is plotted. The size of each point represents the relative
number of observations in each bin.
</div>
<ol>
<li>
<div class="par">
To open the plotting options window, click the light gray box to the
right of the regression table.
<br/>
<img src="styles/imgs/show-plot.png">
</div>
</li>
<li>
<div class="par">
Select the independent (y-axis) and dependent (x-axis) variables and
a monotonic transformation when appropriate.
</div>
<div class="par">
It should plot immediately. Wow! One less click than the
regression table.
</div>
</li>
<li>
<div class="par">
You can fit the data to a linear or quadratic functional form using
the Fit Trend option.
</div>
</li>
<li>
<div class="par">
You can choose any number of bins between 2 and the number of
observations. Any choice outside this range will load a traditional
(unbinned) scatter plot.
</div>
</li>
</ol>
</div>
</body>