0
$\begingroup$

I have the following specification and I am attempting to re-write this in a DiD form which I can then go on to find $\hat{\beta}_{did}$ using OLS.

$n$ observations

$t \in\{1,2\}$ time periods

$x_{it}/y_{it}$ are both iid

$\xi_{it}$ is iid

$x_{it}=1(c_i=1)1(t>1)$

$\alpha_i$ and $\lambda_t$ are fixed effects at the individual and time levels respectively.

$$y_{it}=\alpha_i+x'_{it}\beta+\lambda_t+\xi_{it}$$

My understanding so far is that $x_{it}=1$ only when $t=2$ and $c_i=1$. I have treated $c_i$ as a treatment dummy in this case. I am aiming to construct a regression which incorporates these variables in the DiD specification where $\beta_{did}=(y_{treat,2}-y_{treat,1})-(y_{control,2}-y_{control,1})$.

So far I have specified a time dummy $d_t\in{0,1}$ where $d_t=1$ if $t=2$, and 0 otherwise, and therefore have the following:

$$y_{it}=(\alpha_i+\lambda_1)+d_t(\lambda_2-\lambda_1)...$$

I am not sure how to continue the rest of this regression to incorporate the effect of treatment and the effect of time which interacts with the $\beta_{did}$ coefficient.

$\endgroup$
2
  • $\begingroup$ Welcome. Technically, you already have treatment and time in the model. Your fixed effects replace them. Is the lack of the “interaction” confusing you when looking at this model? $\endgroup$ Commented Dec 10, 2020 at 18:13
  • $\begingroup$ Hi, yes the lack of interaction here has confused me, I have only used the DiD method in a model without fixed effects and I'm really not sure how to treat them here. $\endgroup$
    – user305135
    Commented Dec 10, 2020 at 18:31

1 Answer 1

0
$\begingroup$

In a previous post I addressed why difference-in-differences (DiD) is a special case of fixed effects. In the two-period case where all treated entities receive treatment at the same time, you could replace a treatment dummy with a fixed effect and obtain similar estimates of $\delta$.

Here is the canonical DiD setup with two groups and two time periods:

$$ y_{it} = \alpha + \gamma T_{i} + \lambda d_{t} + \delta(T_{i} \cdot d_{t}) + \epsilon_{it}, $$

where suppose we observe districts $i$ in time periods $t$. In most settings, the data is ‘aggregated up’ to a higher-level (e.g., district/county/state level), where some districts receive some policy/intervention and others do not. You could estimate this equation with dummies for all districts ($i$ units), but the dummies (i.e., district fixed effects) will absorb $T_{i}$. This should be clear to you. $T_{i}$ equals 1 for treated districts, 0 for non-treated districts. By construction, it does not vary over time within a district, thus it will be dropped. Estimating time effects results in redundancies as well. Incorporating dummies for all time periods (i.e., time fixed effects) will absorb $d_{t}$. In this example, $d_{t}$ equals 1 if it is in the second time period, 0 otherwise. In the two period case, time effects involve estimating dummies for all $T-1$ time periods, thus $d_{t}$ is now a redundant regressor by its construction.

The generalization of the foregoing equation would include dummies for each district and each time period but is otherwise unchanged. For example,

$$ y_{it} = \gamma_{i} + \lambda_{t} + \delta D_{it} + \epsilon_{it}, $$

where $D_{it}$ is your interaction term $(T_{i} \cdot d_{t})$ just defined in a different way. Note, $\gamma_{i}$ denotes district fixed effects. The inclusion of dummy variables for all districts is algebraically equivalent to estimation in deviations from means. I hope the foregoing equation is familiar to you, because it resembles your specification which I reproduced below:

$$ y_{it}=\alpha_i + \lambda_t + x'_{it}\beta + \xi_{it} $$

where $\alpha_{i}$ replaces your treatment dummy (i.e., $T_{i}$) and $\lambda_{t}$ replaces your post-treatment indicator (i.e., $d_{t}$). It isn't obvious, but $x_{it}$ is your interaction term. To see why, I examined your definition of what $x_{it}$ is and it explicitly states that it's equal to 1 if $i = 1$ and $t = 2$. In words, your treatment variable (i.e., $x_{it}$) equals unity if a unit is in the treatment group and is in the second time period (i.e., exposure phase), 0 otherwise. Thus, the interaction is implicit in the coding of $x_{it}$ (i.e., $x_{it} = T_{i} \times d_{t}$). Your more general equation doesn't explicitly require the multiplication of two variables; it would be redundant as it is captured in $x_{it}$.

I don't have your data in front of me, but I recommend you try estimating this classical DiD equation with the variables in this precise order:

$$ y_{it} = \alpha_i + \lambda_t + \mu T_{i} + \tau d_{t} + \beta (T_{i} \times d_{t}) + \xi_{it} $$

where, in most software packages, the constituent terms (i.e., $T_{i}$ and $d_{t}$) will be dropped, but your estimate of $\beta$ will remain. In other words, your estimate of the treatment effect should be unaffected by the absorption of the main effects. And, since $T_{i} \times d_{t} = x_{it}$, your results should remain unchanged.

I am not sure how to continue the rest of this regression to incorporate the effect of treatment and the effect of time which interacts with the $\beta_{DiD}$ coefficient.

As shown above, your effect for "treatment" is redundant with the $i$-level fixed effects. Similarly, your effect for "time" is redundant with $t$-level fixed effects. Even the fixed effects themselves (i.e., individual-specific intercepts) are usually not of substantive interest; they are nuisance. Your estimate of $\beta$ is what matters.

Be careful, though. In settings with two groups and two time periods and a standardized exposure period, then all of these approaches should work reasonably well. However, you must use the "generalized" DiD estimator in settings where subsets of units enter into treatment at different times and/or they might have multiple treatment histories. You can also read here for more on the specifics of this estimator.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.