This page contains programmes I have written for various papers. Code has been tested extensively but use it at your own risk. Feedback is welcome.

Nonlinear Difference-in-Differences

This Stata file estimates the nonlinear difference-in-differences model developed by Athey & Imbens (Econometrica, 2006). The file generates graphs and datasets of selected quantile treatment effects on the treated, as well as several extensions proposed in my paper "Academic Peer Effects with Different Group Assignment Policies:"
 - adjusting for covariate differences using propensity score reweighting,
 - estimating average and inequality treatment effects on the treated.

Download here.

Nonparametric Matching

This Python file implements a nonparametric matching estimator of E[Y|X] for binary Y. The estimator is a weighted average of Y for observations with "similar" values of X. Similar is defined with respect to Mahalanobis distance and the weights depend on inverse distances. This implementation is orders of magnitude faster than using Stata's standard routines, though similar speed gains may be possible using Mata.

This file is used in my paper with Josh Hyman, "Data vs Methods: Quasi-Experimental Evaluation of Alternative Sample Selection Corrections for Missing College Entrance Exam Score Data.

Download here.