<p>Let <span class="math-container">$x_{it}$</span> denote after rejection, <span class="math-container">$z_{it}$</span> denote after granted, <span class="math-container">$y_{it}$</span> the outcome, and <span class="math-container">$w_i$</span> is US origin (which should not change over time and doesn't have a <span class="math-container">$t$</span> subscript).</p>
<p>The two-way fixed effect implementation would be,</p>
<p><span class="math-container">$$y_{it} = \beta_0 +\beta_1 x_{it} +\beta_2 z_{it} +\beta_3 x_{it}z_{it}+\beta_4 x_{it}w_i +\beta_5 z_{it}w_i +\beta_6 x_{it}z_{it}w_i+ a_i +c_t +\varepsilon_{it}$$</span></p>
<p>The fixed effect <span class="math-container">$a_i$</span> will capture the binary varaible for <span class="math-container">$w_i$</span>, you don't need to control for it separately. The fixed effect will also capture the effect of being a patent that is ever granted or ever rejected.</p>
<p>Please let me know if this seems weird. I don't think I fully understand your setting.</p>
<p>Also, there is recent literature that the two-way fixed effect diff-in-diff estimator has bias if there are heterogeneous treatment effects and timing (<a href="https://www.sciencedirect.com/science/article/pii/S030440762030378X" rel="nofollow noreferrer">Sun and Abraham 2021</a>). The specification I wrote above is a good starting point to analysis. If you are an undergrad, it should be fine. If you are a graduate student or higher, you will want to consider the alternative estimator that Sun and Abraham developed.</p>

CC BY-SA 4.0
2022-06-02T09:36:07.027Z
Thank you for this comment. However, I am not sure if I capture the interaction effect of the origin variable on the grant x rejection variable with this formula. From my perception, including the origin variable only as separate variable without interaction effect would affect the shift of the curve but not its slope. However, it is the slope of the curve I am interested in.
Nils_Denter
CC BY-SA 4.0
2022-06-02T11:50:06.290Z
I added in interactions with $w_i$. Is this what you mean?
Michael Gmeiner
CC BY-SA 4.0
2022-06-02T12:10:41.003Z
Yes exactly, it this the way it should be?
Nils_Denter
CC BY-SA 4.0
2022-06-03T10:05:38.070Z
If I understand your question correctly, yes.
Michael Gmeiner
CC BY-SA 4.0
2022-06-02T08:19:18.977Z
2022-06-03T10:04:25.287Z
2022-06-03T10:04:25.287Z
Michael Gmeiner
<p>I want to test the following hypotheses with a difference in differences (DiD) OLS model: 1. The post grant effect on the dependent variable is stronger for patents with at least one rejection than for patents with no rejection. 2. This interaction effect is increased if at least one assignee has its base origin outside the US.</p>
<p>I already constructed one time variable (pre grant = 0, post grant = 1), and two treatment variables: rejection variable (received at least one rejection = 1, received no rejection = 0) and origin variable (US origin = 1, non-US origin = 0).
Furthermore, I have several control variables.</p>
<p>How do I have to include these three independent variables? In a conventional DiD (e.g. post and one treatment variable), I include both variables separately as well as their product. But how do I have to do this with two treatment variables? Include all variables separately, all pairwise products (i.e. post x treatment 1, post x treatment 2 and treatment 1 x treatment 2) and the product of all three?</p>

<econometrics><applied-econometrics><regression><difference-in-difference><treatment-effect>
Difference in differences with one post and two treatment variables
Nils_Denter
# Difference in differences with one post and two treatment variables

(Asked by: username_0 on 2022-06-01)

I want to test the following hypotheses with a difference in differences (DiD) OLS model: 1. The post grant effect on the dependent variable is stronger for patents with at least one rejection than for patents with no rejection. 2. This interaction effect is increased if at least one assignee has its base origin outside the US.

I already constructed one time variable (pre grant = 0, post grant = 1), and two treatment variables: rejection variable (received at least one rejection = 1, received no rejection = 0) and origin variable (US origin = 1, non-US origin = 0).
Furthermore, I have several control variables.

How do I have to include these three independent variables? In a conventional DiD (e.g. post and one treatment variable), I include both variables separately as well as their product. But how do I have to do this with two treatment variables? Include all variables separately, all pairwise products (i.e. post x treatment 1, post x treatment 2 and treatment 1 x treatment 2) and the product of all three?

**Tags:** econometrics, applied-econometrics, regression, difference-in-difference, treatment-effect


---

## 1 answers

### Answer by username_1 on 2022-06-02. Score: 3 | Accepted answer

Let $x\_{it}$ denote after rejection, $z\_{it}$ denote after granted, $y\_{it}$ the outcome, and $w\_i$ is US origin (which should not change over time and doesn't have a $t$ subscript).

The two-way fixed effect implementation would be,

$$y\_{it} = \beta\_0 +\beta\_1 x\_{it} +\beta\_2 z\_{it} +\beta\_3 x\_{it}z\_{it}+\beta\_4 x\_{it}w\_i +\beta\_5 z\_{it}w\_i +\beta\_6 x\_{it}z\_{it}w\_i+ a\_i +c\_t +\varepsilon\_{it}$$

The fixed effect $a\_i$ will capture the binary varaible for $w\_i$, you don't need to control for it separately. The fixed effect will also capture the effect of being a patent that is ever granted or ever rejected.

Please let me know if this seems weird. I don't think I fully understand your setting.

Also, there is recent literature that the two-way fixed effect diff-in-diff estimator has bias if there are heterogeneous treatment effects and timing ([Sun and Abraham 2021](https://www.sciencedirect.com/science/article/pii/S030440762030378X)). The specification I wrote above is a good starting point to analysis. If you are an undergrad, it should be fine. If you are a graduate student or higher, you will want to consider the alternative estimator that Sun and Abraham developed.

> **Comments:**
> **username_0**: Thank you for this comment. However, I am not sure if I capture the interaction effect of the origin variable on the grant x rejection variable with this formula. From my perception, including the origin variable only as separate variable without interaction effect would affect the shift of the curve but not its slope. However, it is the slope of the curve I am interested in.  
> **username_1**: I added in interactions with $w_i$. Is this what you mean?  
> **username_0**: Yes exactly, it this the way it should be?  
> **username_1**: If I understand your question correctly, yes.  

---

