Residualise the outcome on covariates using untreated cells only
Source:R/project_out_covariates.R
project_out_covariates.RdThe covariate adjustment of Kranz (2022): regress the outcome on the
covariates with unit and time fixed effects, using only the untreated
unit-periods – every control-unit cell plus the treated unit's
pre-period – then subtract the covariates' fitted contribution from the
whole outcome matrix. Fitting on untreated cells keeps the treatment
effect out of the covariate coefficients. The residualised matrix is then
passed to fit_sdid() as Y with no X.
Value
Y with the covariates' estimated contribution removed, with the
coefficients attached as the "beta" attribute. A covariate that is
collinear with the fixed effects gets an NA coefficient and is left
out of the adjustment.
Details
This is the alternative to handing X to synthdid, which estimates the
coefficients jointly with the synthetic-control weights. The two can give
materially different answers when the covariates are strongly related to
the outcome; comparing them is a useful robustness check.
The coefficients are estimated once, on the real treatment assignment. Placebo inference on the residualised matrix therefore holds them fixed rather than re-estimating them for each placebo.