<blockquote>
<p>(1) whether we should not run the group and period fixed effect for simple DID because they will swallow the variables <span class="math-container">$P_t$</span> and <span class="math-container">$T_i$</span> as in the generalized case?</p>
</blockquote>
<p>In a simple 2 period 2 group regression, the <span class="math-container">$P_t$</span> and <span class="math-container">$T_i$</span> variables <strong>are</strong> capturing the time and group fixed effect. In fact, the regression with fixed effects is formally identical to the simple DiD specification.</p>
<p>To see this assume that there are two time periods <span class="math-container">$t = 0,1$</span> and two groups <span class="math-container">$g = 0,1$</span> then the estimation with fixed effects takes the form:
<span class="math-container">$$
y_{i,t,g} = \alpha_0 D_i(t=0) + \alpha_1 D_i(t = 1) + \alpha_2 D_i(g = 0) + \alpha_3 D_i(g = 1) + \alpha_4 x_{i,t,g} + \varepsilon_{i,t,g}.
$$</span>
Here <span class="math-container">$D_i(t = 0)$</span> is a dummy that equals one if <span class="math-container">$t = 0$</span>, etc.</p>
<p>If there are only two time periods, we have that <span class="math-container">$D_i(t = 0) = 1 - D_i(t = 1)$</span> and <span class="math-container">$D_i(g = 0) = 1 - D_i(g = 1)$</span>. Using this substitution gives:
<span class="math-container">$$
y_{i,t,g} = \underbrace{(\alpha_0 + \alpha_2)}_{\beta_0} + \underbrace{(\alpha_1 - \alpha_0)}_{\beta_1} D_i(t = 1) + \underbrace{(\alpha_3 - \alpha_2)}_{\beta_2} D_i(g = 1) + \alpha_4 x_{i,t,g} + \varepsilon_{i,t,g}.
$$</span>
If we denote  <span class="math-container">$T_i = D_i(t = 1)$</span>, <span class="math-container">$P_i = D_i(g = 1)$</span> and if we consider the case where <span class="math-container">$x_{i,t,g} = T_i P_i$</span> we obtain:
<span class="math-container">$$
y_{i,t,g} = \beta_0 + \beta_1 T_i + \beta_2 P_i + \alpha_4 T_i P_i + \varepsilon_{i,t,g}.
$$</span>
So <span class="math-container">$\alpha_4$</span> is exactly the DiD estimator for a model with time and group fixed effects; The <span class="math-container">$\beta$</span>-parameters are simple linear combinations of the <span class="math-container">$\alpha$</span>-parameters.</p>

CC BY-SA 4.0
2021-06-09T05:11:30.883Z
Thanks, @tdm, I understand the mathematic explanation. I just want to boil it down to a simple conclusion. SO, does it mean that in simple DID, **Post** and **Treat** are also group and period fixed effect?
Phil Nguyen
CC BY-SA 4.0
2021-06-10T09:37:41.810Z
@BeautifulMindset Yes indeed.
tdm
CC BY-SA 4.0
2021-06-08T07:55:48.417Z
2021-06-08T07:55:48.417Z
tdm
<p>After a couple of questions being asked, I am curious about the inclusion of Post and Treat variable in a simple DID (two groups two-time period). We mainly know there are mainly two types of DID including <a href="https://medium.com/eatpredlove/regression-difference-in-differences-208c2e787fd2" rel="nofollow noreferrer">simple and generalised</a>.</p>
<p>From the genralized DID, from <a href="https://stats.stackexchange.com/questions/526619/why-do-not-we-include-post-and-treatment-variables-separarately-in-generalized-d">this discussion</a>, we can see that <strong>Post</strong> and <strong>Treat</strong> are not included into the regression equation because they will be swallowed by group and period fixed effects (normally we call firm and year fixed effects).</p>
<p>I revisit the equation of simple DID in <a href="https://medium.com/eatpredlove/regression-difference-in-differences-208c2e787fd2" rel="nofollow noreferrer">this link</a>:</p>
<p><span class="math-container">$$Y_{it} = \beta_0 + \beta_1*P_t + \beta_2*T_i + \beta_3(P_t*T_i) + u_{it}$$</span></p>
<p>While <span class="math-container">$P_t$</span> and <span class="math-container">$T_i$</span> are Post and Treat variables accordingly.
My concern is</p>
<p>(1) whether we should not run the group and period fixed effect for simple DID because they will swallow the variables <span class="math-container">$P_t$</span> and <span class="math-container">$T_i$</span> as in the generalized case?</p>
<p>(2) And because not running unit and period fixed effect, now <span class="math-container">$u_{it}$</span> would be a mess. I mean
now <span class="math-container">$u_{it}$</span> will include time-variant, time-invariant variables and variables vary across both over time and firms, for example, from <a href="https://economics.stackexchange.com/questions/44295/why-we-need-to-add-firm-and-year-relating-independent-variables-in-two-way-fixed/45333#45333">this discussion</a>:</p>
<p><span class="math-container">$$u_{i,t} = \delta_i + \gamma_t + \chi_{i,t}
$$</span></p>
<p>In generalised DID, because we control for group and period fixed effect, so we only need to add independent variables to satisfy
<span class="math-container">$$
\mathbb{E}(\chi x) = 0
$$</span>
Is it correct?</p>
<p>If it is the case, because it seems that we cannot control firm and year fixed effect in simple DID. Therefore, we need to add more variables to try to reach
<span class="math-container">$$\mathbb{E}(\delta x) =0$$</span> and  <span class="math-container">$$\mathbb{E}(\gamma x)=0$$</span> apart from <span class="math-container">$$\mathbb{E}(\chi x) = 0$$</span>
I am wondering that apart from adding too many independent variables, which can cause <strong>multicollinearity</strong> problems, is there any other solution to solve the messy error term in simple DID?</p>

<econometrics><fixed-effects>
A revisit to simple DID and Generalised DID
Phil Nguyen
# A revisit to simple DID and Generalised DID

(Asked by: username_0 on 2021-06-08)

After a couple of questions being asked, I am curious about the inclusion of Post and Treat variable in a simple DID (two groups two-time period). We mainly know there are mainly two types of DID including [simple and generalised](https://medium.com/eatpredlove/regression-difference-in-differences-208c2e787fd2).

From the genralized DID, from [this discussion](https://stats.stackexchange.com/questions/526619/why-do-not-we-include-post-and-treatment-variables-separarately-in-generalized-d), we can see that **Post** and **Treat** are not included into the regression equation because they will be swallowed by group and period fixed effects (normally we call firm and year fixed effects).

I revisit the equation of simple DID in [this link](https://medium.com/eatpredlove/regression-difference-in-differences-208c2e787fd2):

$$Y\_{it} = \beta\_0 + \beta\_1\*P\_t + \beta\_2\*T\_i + \beta\_3(P\_t\*T\_i) + u\_{it}$$

While $P\_t$ and $T\_i$ are Post and Treat variables accordingly.
My concern is

(1) whether we should not run the group and period fixed effect for simple DID because they will swallow the variables $P\_t$ and $T\_i$ as in the generalized case?

(2) And because not running unit and period fixed effect, now $u\_{it}$ would be a mess. I mean
now $u\_{it}$ will include time-variant, time-invariant variables and variables vary across both over time and firms, for example, from [this discussion](https://economics.stackexchange.com/questions/44295/why-we-need-to-add-firm-and-year-relating-independent-variables-in-two-way-fixed/45333#45333):

$$u\_{i,t} = \delta\_i + \gamma\_t + \chi\_{i,t}
$$

In generalised DID, because we control for group and period fixed effect, so we only need to add independent variables to satisfy
$$
\mathbb{E}(\chi x) = 0
$$
Is it correct?

If it is the case, because it seems that we cannot control firm and year fixed effect in simple DID. Therefore, we need to add more variables to try to reach
$$\mathbb{E}(\delta x) =0$$ and $$\mathbb{E}(\gamma x)=0$$ apart from $$\mathbb{E}(\chi x) = 0$$
I am wondering that apart from adding too many independent variables, which can cause **multicollinearity** problems, is there any other solution to solve the messy error term in simple DID?

**Tags:** econometrics, fixed-effects


---

## 1 answers

### Answer by username_1 on 2021-06-08. Score: 2 | Accepted answer

> (1) whether we should not run the group and period fixed effect for simple DID because they will swallow the variables $P\_t$ and $T\_i$ as in the generalized case?

In a simple 2 period 2 group regression, the $P\_t$ and $T\_i$ variables **are** capturing the time and group fixed effect. In fact, the regression with fixed effects is formally identical to the simple DiD specification.

To see this assume that there are two time periods $t = 0,1$ and two groups $g = 0,1$ then the estimation with fixed effects takes the form:
$$
y\_{i,t,g} = \alpha\_0 D\_i(t=0) + \alpha\_1 D\_i(t = 1) + \alpha\_2 D\_i(g = 0) + \alpha\_3 D\_i(g = 1) + \alpha\_4 x\_{i,t,g} + \varepsilon\_{i,t,g}.
$$
Here $D\_i(t = 0)$ is a dummy that equals one if $t = 0$, etc.

If there are only two time periods, we have that $D\_i(t = 0) = 1 - D\_i(t = 1)$ and $D\_i(g = 0) = 1 - D\_i(g = 1)$. Using this substitution gives:
$$
y\_{i,t,g} = \underbrace{(\alpha\_0 + \alpha\_2)}\_{\beta\_0} + \underbrace{(\alpha\_1 - \alpha\_0)}\_{\beta\_1} D\_i(t = 1) + \underbrace{(\alpha\_3 - \alpha\_2)}\_{\beta\_2} D\_i(g = 1) + \alpha\_4 x\_{i,t,g} + \varepsilon\_{i,t,g}.
$$
If we denote $T\_i = D\_i(t = 1)$, $P\_i = D\_i(g = 1)$ and if we consider the case where $x\_{i,t,g} = T\_i P\_i$ we obtain:
$$
y\_{i,t,g} = \beta\_0 + \beta\_1 T\_i + \beta\_2 P\_i + \alpha\_4 T\_i P\_i + \varepsilon\_{i,t,g}.
$$
So $\alpha\_4$ is exactly the DiD estimator for a model with time and group fixed effects; The $\beta$-parameters are simple linear combinations of the $\alpha$-parameters.

> **Comments:**
> **username_0**: Thanks, @username_1, I understand the mathematic explanation. I just want to boil it down to a simple conclusion. SO, does it mean that in simple DID, **Post** and **Treat** are also group and period fixed effect?  
> **username_1**: @BeautifulMindset Yes indeed.  

---

