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
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.
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. These are standalone, ungraded practices outside the numbered lectures; no homework is attached.
Download the complete AER workshop (.zip) — all four scripts and slide decks, data, the student guide, recovery files and reference outputs (12.3 MB).
Extract the whole ZIP and open Class4B_AER.Rproj. Install tidyverse and haven before starting; the GIS extension also needs sf. Run short chunks alongside the instructor, then adapt the code during the exercises. Everything runs offline after package installation. The separate scripts below use the data included in the ZIP.
| Practice | Prerequisites | Time | Materials |
|---|---|---|---|
| A · Build the dataset | Importing, cleaning and joins | 90 min | Slides · R script |
| B · Reproduce figures | Visualization | 90 min | Slides · R script |
| C · Models and randomization inference | Programming and experiments | 90 min | Slides · R script |
| GIS · Map county coverage | Spatial data | 45 min | Slides · R script |
Study: Romero, Sandefur and Sandholtz (2020), American Economic Review 110(2). I am a coauthor of the study. The AER replication package is licensed CC0 1.0. The county boundaries retain their separate CC BY-NC-SA 3.0 US license; source details and license notices are included in the workshop.
Earlier three-year endline edition
The earlier workshop ZIP remains available as an archive. Use its own scripts and data rather than combining files from the two editions. Its data come from the three-year endline replication package, licensed CC BY 4.0, for Romero and Sandefur (2022), Economic Journal 132(644).
Problem Sets
Data
The running example for the course. Neither analysis file sits ready-made on a portal: both were cut from the national releases by the build script, so you can rebuild either one.
municipios_clean.csv— 2,469 municipios: population, schooling, illiteracy, poverty ratesenigh_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: 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.