We combine two recently proposed nonparametric difference-in-differences
methods, extending them to enable the examination of treatment effect
heterogeneity in the staggered adoption setting using machine learning. The
proposed method, machine learning difference-in-differences (MLDID), allows for
estimation of time-varying conditional average treatment effects on the
treated, which can be used to conduct detailed inference on drivers of
treatment effect heterogeneity. We perform simulations to evaluate the
performance of MLDID and find that it accurately identifies the true predictors
of treatment effect heterogeneity. We then use MLDID to evaluate the
heterogeneous impacts of Brazil's Family Health Program on infant mortality,
and find those in poverty and urban locations experienced the impact of the
policy more quickly than other subgroups