Seminario de Análisis Empírico
Fall 2026
Tentative — subject to change during the term.
Syllabus
Slides
- Lecture 1 - Where data comes from: surveys, administrative records, and big data
- Lecture 2 - Your AI chat partner: LLMs as a chatbot
- Lecture 3 - R fundamentals
- Lecture 4 - Data in R: import, clean, transform, join
- Lecture 5 - Programming in R: for loops, if statements, and functions
- Lecture 6 - Scientific figures with ggplot2
- Lecture 7 - Spatial data, maps, and analysis in R
Examples of empirical work
R Code
Each script reproduces every output printed on the matching slides. Class3.R, Class4.R and Class6.R read the data files listed below by relative paths, so run them from the folder that contains data/; Class6.R writes its figures to a Figures/ folder it creates. Class5.R needs no data file.
- Lecture 3 -
Class3.R - Lecture 4 -
Class4.R - Lecture 5 -
Class5.R - Lecture 6 -
Class6.R - Lecture 7 - R scripts and data (.zip)
The Lecture 7 download includes the PDF, scripts, and data. Extract the folder and run the scripts from the folder that contains Rcode/ and data/.
Practice sessions
Three guided 90-minute practices use the one-year Partnership Schools for Liberia evaluation to build an analysis dataset, reproduce figures, and fit published models. A separate 45-minute GIS extension maps county coverage.
Download the complete AER workshop (.zip) — the four scripts, the background slides, data, the student guide and reference outputs.
Background slides (PDF) cover the program, the experiment and the data. The practice itself is in the scripts.
| Practice | Prerequisites | Time | Script |
|---|---|---|---|
| 1 · Build the dataset | Importing, cleaning and joins | 90 min | Class4B_1_Dataset.R |
| 2 · Reproduce figures | Visualization | 90 min | Class4B_2_Figures.R |
| 3 · Models and randomization inference | Programming and experiments | 90 min | Class4B_3_RI.R |
| 4 · Map county coverage | Spatial data | 45 min | Class4B_4_GIS.R |
Study: Romero, Sandefur and Sandholtz (2020), American Economic Review 110(2).
Problem Sets
Data
- Lecture 6 — Municipal data (CSV): population, schooling, illiteracy, and poverty rates for 2,469 municipios. Save the file as
data/municipios_clean.csv(remove the download’sAnalisisEmpirico_202602_prefix). - Lecture 7 — Spatial data and scripts (ZIP): municipal and alcaldía boundaries, poverty, ECOBICI stations and flows, elevation, and air quality. Extract the ZIP and keep its folder structure; the input files are in
data/L07/teaching/. The bundle also includes the scripts, lecture PDF, and data documentation.
Run the scripts from the folder that contains data/ (and Rcode/ for Lecture 7).
Other course data and preparation scripts:
enigh_hogares_raw.csv— 91,414 households: income, household size, state, survey weightconeval_pobreza.csv— CONEVAL poverty indicators, for the join exercisesbuild_data_real.R— the script that produces all threeconeval_municipal_2020_raw.csv— 2,469 × 37, the CONEVAL release uncleaned: this is the file Lecture 4 cleans on screen- Read me first — provenance, attribution, and what to read before you compute anything
Sources for the municipal and ENIGH files: INEGI, Censo de Población y Vivienda 2020 · INEGI, ENIGH 2024 · CONEVAL, Medición de la pobreza municipal 2020. Accessed 2026-08-16. Nothing in these files is simulated or imputed.