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 session
A standalone 90-minute walkthrough, run entirely in R: turn three files from a real randomized evaluation — Partnership Schools for Liberia — into one student-level dataset. Not one of the numbered lectures, and no homework is attached. Extract the ZIP, open Class4B.Rproj, and install tidyverse and haven before you start. Everything the session needs is inside and it runs offline.
- Liberia PSL - full workshop folder (
.zip) — script, data, slides, recovery files, reference outputs - Liberia PSL - slides
- Liberia PSL -
Class4B.R
Data: Romero, Sandefur and Rodriguez-Ramirez (2021), replication package, licensed CC BY 4.0, for Romero and Sandefur (2022), Economic Journal 132(644). Original study: Romero, Sandefur and Sandholtz (2020), American Economic Review 110(2).
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.