Mathematical Background
The hddid package implements the doubly robust semiparametric
difference-in-differences estimator from:
Ning, Y., Peng, S., & Tao, J. (2020). Doubly robust semiparametric difference-in-differences estimators with high-dimensional data. arXiv preprint arXiv:2009.03151.
Model
The partially linear model is:
where \(\beta_0 \in \mathbb{R}^p\) (sparse, \(p \gg n\)) and \(f_0(\cdot)\) is a smooth nonparametric function.
Key Equations
Eq. (2.5)/(2.7): Doubly Robust Score
Implemented by hddid.build_score_payload().
Eq. (3.1): Second-Stage LASSO
Implemented by hddid.estimate_eq31_mainline() and called automatically by
hddid.fit_hddid().
Eq. (4.2): Dantzig Selector
Implemented by hddid.solve_eq42_sparse_direction() and used inside
hddid.estimate_parametric_inference().
Eq. (4.3): Nonparametric Projection
Implemented by hddid.solve_eq43_projection_matrix() and used inside
hddid.estimate_nonparametric_inference().
Cross-Fitting and Neyman Orthogonality
The first-stage propensity score and conditional outcome means are estimated
with sample splitting so that the nuisance models are trained on data separate
from the observations that contribute to the doubly-robust score. This
sample-splitting (implemented by hddid.make_crossfit_splits() and
hddid.CrossfitNuisanceEstimator) removes the first-order bias from
plug-in nuisance estimation and makes the score Neyman-orthogonal. As a
result, the second-stage LASSO in Eq. (3.1) remains valid when the nuisance
estimators converge at slower-than-parametric rates.