<p>Assume you have a dataset <span class="math-container">$\{Y_{it},X_{it},D_{it}\}$</span> where <span class="math-container">$Y_{it}$</span> is the dependent variable, <span class="math-container">$X_{it}$</span> are control variables and <span class="math-container">$D_{it}$</span> is an indicator which for observational unit <span class="math-container">$i$</span> is equal to <span class="math-container">$1$</span> for all <span class="math-container">$t \geq t^\star_i$</span> and <span class="math-container">$0$</span> for all <span class="math-container">$t&lt;t^\star_i$</span>, where <span class="math-container">$t^\star_i$</span> is the time period where unit <span class="math-container">$i$</span> receives treatment.</p>
<p>We then assumed that there would be no dropout of treatment after receiving it (in the diff-and-diff literature this is referred to as treatment being an <em>absorbing</em> state).</p>
<p>In the simple diff-and-diff you have a control group that never receives treatment <span class="math-container">$D_{it}=0$</span> for all <span class="math-container">$t$</span> for all <span class="math-container">$i \in \mathcal G_c$</span> where <span class="math-container">$\mathcal G_c$</span> is the group of observational units in the control group. And a group <span class="math-container">$\mathcal G_{t^\star}$</span> of observational units that are treated at time <span class="math-container">$t^\star$</span>.</p>
<p>In this case you can simply regress</p>
<p><span class="math-container">$$(1) \ \  \ Y_{it} = \delta_t + \mu_g + \lambda D_{it} + \beta X_{it} + \epsilon_{it},$$</span></p>
<p>where <span class="math-container">$\delta_t$</span> is time fixed effects and <span class="math-container">$\mu_g$</span> are group fixed effects.</p>
<p>It would help if you played around with these simple diff-and-diff setups. This will give you a feel about how data is behaving. Also, it will allow you to experiment with constructing <span class="math-container">$\mathcal G_c$</span> in different ways.</p>
<p>You can perfectly well estimate equation (1) with several groups that are treated at different times. <strong>There is no <em>post_rep</em> variable whose definition depends on the non-ambiguity of treatment timing. Instead, the specification uses time dummies.</strong></p>
<p>However, estimating (1) has been criticized in a newer strand of diff-and-diff literature. The specification imposes that (a) all units have the same treatment effect, and (b) the treatment has the same effect regardless of how long it has been since treatment started. You can have a look at this review paper:</p>
<p><a href="https://arxiv.org/pdf/2201.01194" rel="nofollow noreferrer">What’s Trending in Difference-in-Differences?
A Synthesis of the Recent Econometrics Literature</a></p>
<p>These slides explain simple 2x2 diff and diff and then go on to the literature on staggered diff-and-diff</p>
<p><a href="https://www.parisschoolofeconomics.eu/docs/heim-arthur/lecture_4_introdid.pdf" rel="nofollow noreferrer">Diff-and-diff slides</a></p>
<p>The short story is that I cannot tell you what to do if you don't buy the assumptions (a) and (b) because in that case there are multiple ways to move on.
However, the simplest way of allowing for treatment heterogeneity is simply to run simple diff-and-diff specifications for the different treated groups whose treatment you believe to be different.</p>
<p>You can always raise a new question once you have mastered the basics.</p>

CC BY-SA 4.0
2024-07-29T15:24:51.330Z
Thank you very much for your answer, now it's much more clear for me. One last question, is there a way to plot this model? (from my understanding, this would be a generalized DiD). Or, should I have to do an Event study and plot that?
LauraGonzalezGa
CC BY-SA 4.0
2024-07-29T17:42:58.763Z
I think you could learn a lot by doing event study plots. Especially if you do event study plots and see how they vary according to how you design the control and treatment group. So do event study plot using (1)  different control groups but holding the treatment group constant and (2) Different treatment groups but holding the control group constant. I would go with event study plots. It should also be possible to use the FWL theorem to do advanced event-study plots where you first filter for the control variables. Consider posting a question on this.
Jesper Hybel
CC BY-SA 4.0
2024-07-29T17:55:13.787Z
Ok, you have already posted on CrossValidated. I wish you luck.
Jesper Hybel
CC BY-SA 4.0
2024-07-21T21:19:22.490Z
2024-07-22T07:25:39.980Z
2024-07-22T07:25:39.980Z
Jesper Hybel
<p>I want to estimate the impact that replications have on the citations. For that, I want to make a staggered diff-in-diff, comparing replicated papers vs non-replicated ones.</p>
<p>In my data set I have around 80 papers that were replicated (therefore my treatment group), and 160 that were never replicated. To ensure comparability, I took only empirical papers that were published in the same journals, volumes, issues, and about the same topics or JEL code.</p>
<p>My date looks sth like this:
<a href="https://i.sstatic.net/VRjgDSth.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/VRjgDSth.png" alt="Example dataset" /></a></p>
<p>My supervisor suggested to start with a &quot;simple&quot; diff in diff,to see some initial effect and then proceed to do the staggered version (and probably th a Poisson regression since my dependent variable is a non-negative count number).</p>
<p>For the diff in diff, my treatment dummy is &quot;replicated&quot;, which is 1 for replicated papers and 0 for the rest. And my problem/question is with my time dummy d_time, because: as you can see, my treated observations have different treatment years. In this example, one was treated in 2021 and the other one in 2018. But I have 80 papers that were replicated in total, so each was replicated in different years. So, there is a before and after for the control group, but there is no specific before and after for all the treatment so I don't know what to compare against.</p>
<p>Would it be ok, that my time dummy d_time, takes the values of 0 for all my control ones? However, I think is because of this that I get collinearity in my first results:</p>
<p><a href="https://i.sstatic.net/9QMPds2K.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/9QMPds2K.png" alt="Initial results" /></a></p>
<p>Am I doing something completly wrong? Could someone share some light for me? I'm very new at this, I apologize if this is not clear but I hope it is.</p>
<p><strong>EDIT</strong></p>
<p>The suggested &quot;simple&quot; Diff-in-Diff would look something like this:
<a href="https://i.sstatic.net/f5xmkxe6.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/f5xmkxe6.png" alt="equation" /></a></p>
<p>Would it be ok for the control group (replicated=0), to have a 0 in the post_rep column? while only the treated group (replicated=1) does have 0 and 1? Would it make sense to make such an analysis?</p>

CC BY-SA 4.0
2024-07-14T14:53:35.827Z
You should write up a regression equation for clarity and to help yourself to gain clarity. Define the variables in the regression equation clearly. Maybe start as simple as with one paper en control group and one paper in treatment. .... Asking whether you are doing something completely wrong is not the best question. When is something completely wrong ... I think you need focus. Doing something simple is usually helpful for gaining focus (as your advisor suggested).
Jesper Hybel
CC BY-SA 4.0
2024-07-14T15:00:37.577Z
The treated will be 1 in months after treatment otherwise 0. Control is always 0. But since the staggered design is a weighted average of all the different treatment timing groups .. so good idea to focus on on group ...
Jesper Hybel
CC BY-SA 4.0
2024-07-15T21:35:50.123Z
Thank you for your comments. I included an edit with the "simple" diff in diff model. With regards to your second comment, isn't it an issue that my control is always 0 in the before and after? I'm very new to this and that's why I'm a bit lost
LauraGonzalezGa
CC BY-SA 4.0
2024-07-16T06:12:14.437Z
Ok thank you for writing the equation. Yes, there is a problem. Easy to fix. I can write an answer later today.
Jesper Hybel
CC BY-SA 4.0
2024-07-21T13:53:04.293Z
Hi Jesper, I haven't found a way to properly solved this, I was wondering if you could let me know you're idea. Thank you
LauraGonzalezGa
<econometrics><applied-econometrics><difference-in-difference><treatment-effect>
Diff-in-diff with different treatment years, what would be time dummy for control?
LauraGonzalezGa
# Diff-in-diff with different treatment years, what would be time dummy for control?

(Asked by: username_0 on 2024-07-14)

I want to estimate the impact that replications have on the citations. For that, I want to make a staggered diff-in-diff, comparing replicated papers vs non-replicated ones.

In my data set I have around 80 papers that were replicated (therefore my treatment group), and 160 that were never replicated. To ensure comparability, I took only empirical papers that were published in the same journals, volumes, issues, and about the same topics or JEL code.

My date looks sth like this:
[![Example dataset](https://i.sstatic.net/VRjgDSth.png)](https://i.sstatic.net/VRjgDSth.png)

My supervisor suggested to start with a "simple" diff in diff,to see some initial effect and then proceed to do the staggered version (and probably th a Poisson regression since my dependent variable is a non-negative count number).

For the diff in diff, my treatment dummy is "replicated", which is 1 for replicated papers and 0 for the rest. And my problem/question is with my time dummy d\_time, because: as you can see, my treated observations have different treatment years. In this example, one was treated in 2021 and the other one in 2018. But I have 80 papers that were replicated in total, so each was replicated in different years. So, there is a before and after for the control group, but there is no specific before and after for all the treatment so I don't know what to compare against.

Would it be ok, that my time dummy d\_time, takes the values of 0 for all my control ones? However, I think is because of this that I get collinearity in my first results:

[![Initial results](https://i.sstatic.net/9QMPds2K.png)](https://i.sstatic.net/9QMPds2K.png)

Am I doing something completly wrong? Could someone share some light for me? I'm very new at this, I apologize if this is not clear but I hope it is.

**EDIT**

The suggested "simple" Diff-in-Diff would look something like this:
[![equation](https://i.sstatic.net/f5xmkxe6.png)](https://i.sstatic.net/f5xmkxe6.png)

Would it be ok for the control group (replicated=0), to have a 0 in the post\_rep column? while only the treated group (replicated=1) does have 0 and 1? Would it make sense to make such an analysis?

**Tags:** econometrics, applied-econometrics, difference-in-difference, treatment-effect
> **Comments:**
> **username_1**: You should write up a regression equation for clarity and to help yourself to gain clarity. Define the variables in the regression equation clearly. Maybe start as simple as with one paper en control group and one paper in treatment. .... Asking whether you are doing something completely wrong is not the best question. When is something completely wrong ... I think you need focus. Doing something simple is usually helpful for gaining focus (as your advisor suggested).  
> **username_1**: The treated will be 1 in months after treatment otherwise 0. Control is always 0. But since the staggered design is a weighted average of all the different treatment timing groups .. so good idea to focus on on group ...  
> **username_0**: Thank you for your comments. I included an edit with the "simple" diff in diff model. With regards to your second comment, isn't it an issue that my control is always 0 in the before and after? I'm very new to this and that's why I'm a bit lost  
> **username_1**: Ok thank you for writing the equation. Yes, there is a problem. Easy to fix. I can write an answer later today.  
> **username_0**: Hi Jesper, I haven't found a way to properly solved this, I was wondering if you could let me know you're idea. Thank you  

---

## 1 answers

### Answer by username_1 on 2024-07-21. Score: 2 | Accepted answer

Assume you have a dataset $\{Y\_{it},X\_{it},D\_{it}\}$ where $Y\_{it}$ is the dependent variable, $X\_{it}$ are control variables and $D\_{it}$ is an indicator which for observational unit $i$ is equal to $1$ for all $t \geq t^\star\_i$ and $0$ for all $t, where $t^\star\_i$ is the time period where unit $i$ receives treatment.

We then assumed that there would be no dropout of treatment after receiving it (in the diff-and-diff literature this is referred to as treatment being an *absorbing* state).

In the simple diff-and-diff you have a control group that never receives treatment $D\_{it}=0$ for all $t$ for all $i \in \mathcal G\_c$ where $\mathcal G\_c$ is the group of observational units in the control group. And a group $\mathcal G\_{t^\star}$ of observational units that are treated at time $t^\star$.

In this case you can simply regress

$$(1) \ \ \ Y\_{it} = \delta\_t + \mu\_g + \lambda D\_{it} + \beta X\_{it} + \epsilon\_{it},$$

where $\delta\_t$ is time fixed effects and $\mu\_g$ are group fixed effects.

It would help if you played around with these simple diff-and-diff setups. This will give you a feel about how data is behaving. Also, it will allow you to experiment with constructing $\mathcal G\_c$ in different ways.

You can perfectly well estimate equation (1) with several groups that are treated at different times. **There is no *post\_rep* variable whose definition depends on the non-ambiguity of treatment timing. Instead, the specification uses time dummies.**

However, estimating (1) has been criticized in a newer strand of diff-and-diff literature. The specification imposes that (a) all units have the same treatment effect, and (b) the treatment has the same effect regardless of how long it has been since treatment started. You can have a look at this review paper:

[What’s Trending in Difference-in-Differences?
A Synthesis of the Recent Econometrics Literature](https://arxiv.org/pdf/2201.01194)

These slides explain simple 2x2 diff and diff and then go on to the literature on staggered diff-and-diff

[Diff-and-diff slides](https://www.parisschoolofeconomics.eu/docs/heim-arthur/lecture_4_introdid.pdf)

The short story is that I cannot tell you what to do if you don't buy the assumptions (a) and (b) because in that case there are multiple ways to move on.
However, the simplest way of allowing for treatment heterogeneity is simply to run simple diff-and-diff specifications for the different treated groups whose treatment you believe to be different.

You can always raise a new question once you have mastered the basics.

> **Comments:**
> **username_0**: Thank you very much for your answer, now it's much more clear for me. One last question, is there a way to plot this model? (from my understanding, this would be a generalized DiD). Or, should I have to do an Event study and plot that?  
> **username_1**: I think you could learn a lot by doing event study plots. Especially if you do event study plots and see how they vary according to how you design the control and treatment group. So do event study plot using (1)  different control groups but holding the treatment group constant and (2) Different treatment groups but holding the control group constant. I would go with event study plots. It should also be possible to use the FWL theorem to do advanced event-study plots where you first filter for the control variables. Consider posting a question on this.  
> **username_1**: Ok, you have already posted on CrossValidated. I wish you luck.  

---

