<commit_before><!doctype html>
<html lang="en">

	<head>
		<meta charset="utf-8">

		<!-- For Google search results -->
		<title>ArcGIS for Economics: Lecture 2</title>
		<meta name="description" content="ArcGIS's Spatial Join for economics researchers">
		<meta name="author" content="<NAME>">

		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">

		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">

		<!-- Activate Reveal.js -->
		<link rel="stylesheet" href="css/reveal.css">

		<!-- Define the theme -->
		<link rel="stylesheet" href="css/theme/white4me.css" id="theme">

		<!-- Code syntax highlighting -->
		<link rel="stylesheet" href="lib/css/tomorrow.css">

		<!-- Printing and PDF exports -->
		<script>
			var link = document.createElement( 'link' );
			link.rel = 'stylesheet';
			link.type = 'text/css';
			link.href = window.location.search.match( /print-pdf/gi ) ? 'css/print/pdf.css' : 'css/print/paper.css';
			document.getElementsByTagName( 'head' )[0].appendChild( link );
		</script>

		<!--Add support for earlier versions of Internet Explorer -->
		<!--[if lt IE 9]>
		<script src="lib/js/html5shiv.js"></script>
		<![endif]-->
	</head>

	<body>

		<!-- To activate the CSS framework of Reveal.js -->
		<div class="reveal">

			<!-- To reconfigure an HTML5 <section> element as a slide using CSS. -->
			<div class="slides">

				<!-- Slide contents start here -->

				<!-- My own slide templates -->
				<section id="title">
					<h3 style="color:slategrey">
						Causal Inference with Spatial Data
					</h3>
					<p style="color:slategrey">
 						(ArcGIS 10 for Economics Research)
					</p>
					<h3>
						Lecture 2
					</h3>
					<h2>
						Spatial Join
					</h2>
					<br>
					<p><NAME></p>
					<p>28 August, 2018</p>
					<br>
					<p>
						<small>Press SPACE to proceed. </small>
						<br>
						<small>To go back to the previous slide, press SHIFT+SPACE. </small>
					</p>
				</section>

				<section id="what_is_spatial_join" data-transition="slide-in fade-out" style="text-align: left;">
					<h3>
						What is Spatial Join?
					</h3>
						<p>
							Match <strong>features</strong> from two vector datasets by location
						</p>
						<ul>
							<li>
								No need of common keys (e.g. district code) to match data
							</li>
							<li>
								Allow you to match administrative data with <strong>natural environment data</strong>
							</li>
						</ul>
				</section>

				<section id="biome" data-transition="fade-in fade-out" style="text-align: left;">
					<h4>
						Example: <a href="https://www.worldwildlife.org/publications/terrestrial-ecoregions-of-the-world">Terrestrial Ecoregions</a>
					</h4>
						<img src="gis_lecture2/biome.png"  style="border: none; background: none; box-shadow:none; width: 600px;">
						<p>
							<a href="http://doi.org/10.1093/qje/qjx030">Henderson et al. (2018)</a> find these ecoregions predict where economic activities take place
						</p>
						<p>
							But we cannot easily match this data to administrative areas without spatial join
						</p>
				</section>

				<section id="benefits" data-transition="fade-in slide-out" style="text-align: left;">
					<h3>
						Spatial Join and Weather Data
					</h3>
					<p>
						Weather data: increasingly popular among economists
					</p>
					<ul>
						<li>
							Interest in climate change (<a href="http://doi.org/10.1257/jel.52.3.740" target="_blank">Dell et al. (2014)</a> for a survey)
						</li>
						<li>
							Since weather is exogenous, causality can be established
						</li>
					</ul>
					<p>
						But <strong>grid cells</strong> are the units of observation in weather data
					</p>
					<p>
						How can we match weather with socio-economic units?
					</p>
					<p>
						$\Rightarrow$ Spatial Join helps
					</p>
				</section>

				<section id="road_map" style="text-align: left;">
					<h3>
						Today's road map
					</h3>
						<p>
							1. Alsan (2015)
						</p>
						<p>
							2. Replicate Alsan (2015)
						</p>
						<p>
							3. Introduction to Python for ArcGIS
						</p>
				</section>

			<!-- SECTION 2 -->
			<section>
				<section id="section2">
					<h1>
						1. <a href="http://dx.doi.org/10.1257/aer.20130604" target="_blank">Alsan (2015)</a>
					</h1>
					<img src="gis_lecture2/Tsetsefly.jpg" style="border: none; background: none; box-shadow:none; width: 400px;">
				</section>

				<section id="rq2" style="text-align: left;">
					<h3>Research Question</h3>
					<p>
						Did Tsetse flies cause Africa's underdevelopment?
					</p>
					<p>
						Important?
					</p>
					<ul>
						<li>
							Tsetse flies, found only in Africa, kill livestock
						</li>
						<li>
							Believed to be a historical cause of Africa's low agricultural productivity & high transportation cost
						</li>
						<li>
							Path dependence may explain Africa's poverty today
						</li>
					</ul>
					<p>
						Original?
					</p>
					<ul>
						<li>
							No systematic evidence on the impact of Tsetse flies
						</li>
						<li>
							Find Tsetse flies prevented political centralization
						</li>
					</ul>
					<p>
						Feasible?
					</p>
				</section>

				<section id="data2a" data-transition="slide-in fade-out" style="text-align: left;">
					<h3>Data Sources</h3>
					<p>
						Ethnographic Atlas + <a href="../gis_lecture1.html#/oldmap2b" target="_blank">Murdock (1959)'s map</a>
					</p>
					<ul>
						<li>
							Pre-colonial data on use of domesticated animals, presence of intensive agriculture, political centralization
						</li>
					</ul>
					<p>
						Weather at 2&degx2&deg grid cells in 1871 from <a href="https://www.esrl.noaa.gov/psd/data/20thC_Rean/" target="_blank">20th Century Reanalysis Project</a>
					</p>
					<ul>
						<li>
							Mean temperature
						</li>
						<li>
							Mean humidity
						</li>
					</ul>
				</section>

				<section id="data2b" data-transition="fade-in fade-out" style="text-align: left;">
					<h3>Construct Tsetse Suitability Index</h3>
					<p>
						Feed temperature and humidity into the following curves (Figure 2 of Alsan 2015)
					</p>
					<img src="gis_lecture2/alsan2015figure2a.png"  style="border: none; background: none; box-shadow:none; width: 400px;">
					<img src="gis_lecture2/alsan2015figure2b.png"  style="border: none; background: none; box-shadow:none; width: 400px;">
					<p>
						$\Rightarrow$ Tsetse Suitability Index (steady-state population)
					</p>
				</section>

				<section id="data2c" data-transition="fade-in slide-out" style="text-align: left;">
					<div style="display: flex; align-items: flex-start;">
						<div class="">
							<h4>Tsetse Suitability</h4>
							<img src="gis_lecture2/alsan2015figure3a.png"  style="border: none; background: none; box-shadow:none; width: 400px;">
						</div>
						<div style="align-self: center;" class="fragment" data-fragment-index="1">
							<h2>+</h2>
						</div>
						<div class="fragment" data-fragment-index="1">
							<h4>Ethnic homelands</h4>
							<img src="gis_lecture2/alsan2015figure5a.png"  style="border: none; background: none; box-shadow:none; width: 420px;">
						</div>
					</div>
					<p class="fragment" data-fragment-index="2">
						We will learn how to match these two data
					</p>
				</section>

				<section id="equation2" style="text-align: left">
					<h3>
						Empirical specification
					</h3>
					<p>
						<!-- Case by Case -->
						\begin{align*}
						Y_j =
						  \alpha + \delta TSI_j + \boldsymbol{X}'_{j}\boldsymbol{\omega} + \varepsilon_{j}
						\end{align*}
					</p>
					<table border="0" width="100%">
						<tr>
							<td style="text-align: right">$Y_j$</td>
							<td>Precolonial outcome for ethnic group $j$</td>
						</tr>
						<tr>
							<td style="text-align: right">$TSI_j$</td>
							<td>Tsetse fly suitability index</td>
						</tr>
						<tr>
							<td style="text-align: right">$\boldsymbol{X}_j$</td>
							<td>Controls (incl.\ temperature, humidity in 1871)</td>
						</tr>
					</table>
				</section>

				<section id="result2" >
					<h4>
						Main Results
					</h4>
					<p>
					<img src="gis_lecture2/alsan_table1.png" style="border: none; background: none; box-shadow:none; width: 750px;">
						<small>(Table 1 of Alsan 2015)</small>
					</p>
				</section>

			</section>

				<section id="preparation1" data-transition="fade-out slide-in" style="text-align: left;">
					<h3>
						Prepare for the rest of this lecture
					</h3>
					<ol>
						<li>
							<a href="https://www.dropbox.com/s/2mx280kfp12j1n5/Lecture2.zip?dl=0" target="_blank">Download the zipped dataset for lecture 2</a>
						</li>
						<ul>
							<li>Save it in Desktop</li>
						</ul>
						<li>
							To unzip, right-click it and choose <span style="background-color: Gainsboro">7-Zip > Extract to "Lecture2\"</span>
						</li>
						<li>
							Launch ArcMap 10 (it takes time)
						</li>
					</ol>
				</section>

				<section id="preparation2" data-transition="fade-out fade-in" style="text-align: left;">
					<h3>
						Prepare for the rest of this lecture
					</h3>
					<p>
						Browse the inside of the <code>Lecture2</code> folder
					</p>
					<p>
						I've created four folders: <code>code</code>, <code>input</code>, <code>output</code>, <strong>and <code>temp</code></strong>
					</p>
					<ul style="margin-left: 72px;">
						<li>
							 <code>code</code>: files that edit datasets (e.g. Python scripts)
						</li>
						<li>
							<code>input</code>: original data files
						</li>
						<li>
							<code>output</code>: data files you have created
						</li>
						<li>
							<strong><code>temp</code>: intermediate data files</strong>
  					</li>
					</ul>
					<p>
						ArcGIS tends to create lots of intermediate data files to create one data file that you really need.
					</p>
				</section>

			<section>
				<section id="section5">
					<h1>
						2. Replicate Alsan (2015)<commit_msg>Remove a slide on directory structure in Lecture 2 #9<commit_after><!doctype html>
<html lang="en">

	<head>
		<meta charset="utf-8">

		<!-- For Google search results -->
		<title>ArcGIS for Economics: Lecture 2</title>
		<meta name="description" content="ArcGIS's Spatial Join for economics researchers">
		<meta name="author" content="<NAME>">

		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">

		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">

		<!-- Activate Reveal.js -->
		<link rel="stylesheet" href="css/reveal.css">

		<!-- Define the theme -->
		<link rel="stylesheet" href="css/theme/white4me.css" id="theme">

		<!-- Code syntax highlighting -->
		<link rel="stylesheet" href="lib/css/tomorrow.css">

		<!-- Printing and PDF exports -->
		<script>
			var link = document.createElement( 'link' );
			link.rel = 'stylesheet';
			link.type = 'text/css';
			link.href = window.location.search.match( /print-pdf/gi ) ? 'css/print/pdf.css' : 'css/print/paper.css';
			document.getElementsByTagName( 'head' )[0].appendChild( link );
		</script>

		<!--Add support for earlier versions of Internet Explorer -->
		<!--[if lt IE 9]>
		<script src="lib/js/html5shiv.js"></script>
		<![endif]-->
	</head>

	<body>

		<!-- To activate the CSS framework of Reveal.js -->
		<div class="reveal">

			<!-- To reconfigure an HTML5 <section> element as a slide using CSS. -->
			<div class="slides">

				<!-- Slide contents start here -->

				<!-- My own slide templates -->
				<section id="title">
					<h3 style="color:slategrey">
						Causal Inference with Spatial Data
					</h3>
					<p style="color:slategrey">
 						(ArcGIS 10 for Economics Research)
					</p>
					<h3>
						Lecture 2
					</h3>
					<h2>
						Spatial Join
					</h2>
					<br>
					<p><NAME></p>
					<p>28 August, 2018</p>
					<br>
					<p>
						<small>Press SPACE to proceed. </small>
						<br>
						<small>To go back to the previous slide, press SHIFT+SPACE. </small>
					</p>
				</section>

				<section id="what_is_spatial_join" data-transition="slide-in fade-out" style="text-align: left;">
					<h3>
						What is Spatial Join?
					</h3>
						<p>
							Match <strong>features</strong> from two vector datasets by location
						</p>
						<ul>
							<li>
								No need of common keys (e.g. district code) to match data
							</li>
							<li>
								Allow you to match administrative data with <strong>natural environment data</strong>
							</li>
						</ul>
				</section>

				<section id="biome" data-transition="fade-in fade-out" style="text-align: left;">
					<h4>
						Example: <a href="https://www.worldwildlife.org/publications/terrestrial-ecoregions-of-the-world">Terrestrial Ecoregions</a>
					</h4>
						<img src="gis_lecture2/biome.png"  style="border: none; background: none; box-shadow:none; width: 600px;">
						<p>
							<a href="http://doi.org/10.1093/qje/qjx030">Henderson et al. (2018)</a> find these ecoregions predict where economic activities take place
						</p>
						<p>
							But we cannot easily match this data to administrative areas without spatial join
						</p>
				</section>

				<section id="benefits" data-transition="fade-in slide-out" style="text-align: left;">
					<h3>
						Spatial Join and Weather Data
					</h3>
					<p>
						Weather data: increasingly popular among economists
					</p>
					<ul>
						<li>
							Interest in climate change (<a href="http://doi.org/10.1257/jel.52.3.740" target="_blank">Dell et al. (2014)</a> for a survey)
						</li>
						<li>
							Since weather is exogenous, causality can be established
						</li>
					</ul>
					<p>
						But <strong>grid cells</strong> are the units of observation in weather data
					</p>
					<p>
						How can we match weather with socio-economic units?
					</p>
					<p>
						$\Rightarrow$ Spatial Join helps
					</p>
				</section>

				<section id="road_map" style="text-align: left;">
					<h3>
						Today's road map
					</h3>
						<p>
							1. Alsan (2015)
						</p>
						<p>
							2. Replicate Alsan (2015)
						</p>
						<p>
							3. Introduction to Python for ArcGIS
						</p>
				</section>

			<!-- SECTION 2 -->
			<section>
				<section id="section2">
					<h1>
						1. <a href="http://dx.doi.org/10.1257/aer.20130604" target="_blank">Alsan (2015)</a>
					</h1>
					<img src="gis_lecture2/Tsetsefly.jpg" style="border: none; background: none; box-shadow:none; width: 400px;">
				</section>

				<section id="rq2" style="text-align: left;">
					<h3>Research Question</h3>
					<p>
						Did Tsetse flies cause Africa's underdevelopment?
					</p>
					<p>
						Important?
					</p>
					<ul>
						<li>
							Tsetse flies, found only in Africa, kill livestock
						</li>
						<li>
							Believed to be a historical cause of Africa's low agricultural productivity & high transportation cost
						</li>
						<li>
							Path dependence may explain Africa's poverty today
						</li>
					</ul>
					<p>
						Original?
					</p>
					<ul>
						<li>
							No systematic evidence on the impact of Tsetse flies
						</li>
						<li>
							Find Tsetse flies prevented political centralization
						</li>
					</ul>
					<p>
						Feasible?
					</p>
				</section>

				<section id="data2a" data-transition="slide-in fade-out" style="text-align: left;">
					<h3>Data Sources</h3>
					<p>
						Ethnographic Atlas + <a href="../gis_lecture1.html#/oldmap2b" target="_blank">Murdock (1959)'s map</a>
					</p>
					<ul>
						<li>
							Pre-colonial data on use of domesticated animals, presence of intensive agriculture, political centralization
						</li>
					</ul>
					<p>
						Weather at 2&degx2&deg grid cells in 1871 from <a href="https://www.esrl.noaa.gov/psd/data/20thC_Rean/" target="_blank">20th Century Reanalysis Project</a>
					</p>
					<ul>
						<li>
							Mean temperature
						</li>
						<li>
							Mean humidity
						</li>
					</ul>
				</section>

				<section id="data2b" data-transition="fade-in fade-out" style="text-align: left;">
					<h3>Construct Tsetse Suitability Index</h3>
					<p>
						Feed temperature and humidity into the following curves (Figure 2 of Alsan 2015)
					</p>
					<img src="gis_lecture2/alsan2015figure2a.png"  style="border: none; background: none; box-shadow:none; width: 400px;">
					<img src="gis_lecture2/alsan2015figure2b.png"  style="border: none; background: none; box-shadow:none; width: 400px;">
					<p>
						$\Rightarrow$ Tsetse Suitability Index (steady-state population)
					</p>
				</section>

				<section id="data2c" data-transition="fade-in slide-out" style="text-align: left;">
					<div style="display: flex; align-items: flex-start;">
						<div class="">
							<h4>Tsetse Suitability</h4>
							<img src="gis_lecture2/alsan2015figure3a.png"  style="border: none; background: none; box-shadow:none; width: 400px;">
						</div>
						<div style="align-self: center;" class="fragment" data-fragment-index="1">
							<h2>+</h2>
						</div>
						<div class="fragment" data-fragment-index="1">
							<h4>Ethnic homelands</h4>
							<img src="gis_lecture2/alsan2015figure5a.png"  style="border: none; background: none; box-shadow:none; width: 420px;">
						</div>
					</div>
					<p class="fragment" data-fragment-index="2">
						We will learn how to match these two data
					</p>
				</section>

				<section id="equation2" style="text-align: left">
					<h3>
						Empirical specification
					</h3>
					<p>
						<!-- Case by Case -->
						\begin{align*}
						Y_j =
						  \alpha + \delta TSI_j + \boldsymbol{X}'_{j}\boldsymbol{\omega} + \varepsilon_{j}
						\end{align*}
					</p>
					<table border="0" width="100%">
						<tr>
							<td style="text-align: right">$Y_j$</td>
							<td>Precolonial outcome for ethnic group $j$</td>
						</tr>
						<tr>
							<td style="text-align: right">$TSI_j$</td>
							<td>Tsetse fly suitability index</td>
						</tr>
						<tr>
							<td style="text-align: right">$\boldsymbol{X}_j$</td>
							<td>Controls (incl.\ temperature, humidity in 1871)</td>
						</tr>
					</table>
				</section>

				<section id="result2" >
					<h4>
						Main Results
					</h4>
					<p>
					<img src="gis_lecture2/alsan_table1.png" style="border: none; background: none; box-shadow:none; width: 750px;">
						<small>(Table 1 of Alsan 2015)</small>
					</p>
				</section>

			</section>

				<section id="preparation1" data-transition="fade-out slide-in" style="text-align: left;">
					<h3>
						Prepare for the rest of this lecture
					</h3>
					<ol>
						<li>
							<a href="https://www.dropbox.com/s/2mx280kfp12j1n5/Lecture2.zip?dl=0" target="_blank">Download the zipped dataset for lecture 2</a>
						</li>
						<ul>
							<li>Save it in Desktop</li>
						</ul>
						<li>
							To unzip, right-click it and choose <span style="background-color: Gainsboro">7-Zip > Extract to "Lecture2\"</span>
						</li>
						<li>
							Launch ArcMap 10 (it takes time)
						</li>
					</ol>
				</section>

			<section>
				<section id="section5">
					<h1>
						2. Replicate Alsan (2015)
{'fraction_non_alphanumeric': 0.1565724308708213, 'fraction_numerical': 0.024143623607098638, 'mean_word_length': 2.4370567375886525, 'pattern_counts': {'":': 0, '<': 581, '<?xml version=': 0, '>': 583, 'https://': 6, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '609019', 'n_tokens_mistral': 9392, 'n_tokens_neox': 6494, 'n_words': 1728}