2
$\begingroup$

I have a difference-in-difference setup where treated units at one point in time can become control groups at a later point in time because there are multiple events that take place which are combined in one model. That is, the units treatment indicator might switch from 1 to 0 (the other way around works as well). This is an unusual DiD-design in the sense that treatment is usually absorbing so a unit that becomes treated stays treated throughout the observation period.

A standard two-way-fixed-effects model to estimate the DiD-estimator in a setting with multiple groups and periods looks like so $y_{it}=\gamma_t + \lambda_i+D{it}+\mu_{it}$. There, the $post$ indicator from the standard DiD-setting is captured by the time fixed effect $\gamma_t$, and the $treatment$ indicator is captured by the unit fixed effect $\lambda_i$.

The latter is because there is no variation in the treatment indicator within each unit. In the case I described above, however, there is variation in the treatment indicator because one unit might be a treatment group for the first event, but can be a control group for the latter event.

How is the TWFE model supposed to look like in such case? Should I just add the treatment indicator to the standard TWFE model like so $y_{it}=\gamma_t + \lambda_i+D{it}+\mu_{it} + Treat_i$? I didn't really find anything about such setting online.

$\endgroup$
3
  • $\begingroup$ Do units switch on and then off, or is there some back and forth between 0 and 1 multiple times over time? $\endgroup$ Commented Nov 10 at 5:24
  • $\begingroup$ So the setup I am talking about is Guest (2021) "The information role of the media in earnings news". It could be that this switching happens multiple times. So for example, a firm could be treatment firm for the first event, then control firm for the second event, and treatment firm for the third event again. $\endgroup$
    – n_arch
    Commented Nov 13 at 16:34
  • $\begingroup$ See my answer below. I also go into detail regarding how the model should look here and discuss R packages to deal with the specific variation you're seeing in the real world here. $\endgroup$ Commented Nov 17 at 18:48

1 Answer 1

1
$\begingroup$

The short answer is that you do not need to add any additional time-invariant variables to the standard two-way fixed effects (TWFE) model. The treatment indicator $D_{it}$ already captures the key variation needed to identify the treatment effect, as it retains the characteristics of the standard differences-in-differences (DiD) interaction term. Furthermore, $D_{it}$ can be coded flexibly to account for different types of treatment variation, including situations with on/off or intermittent treatments, without introducing additional time-invariant variables. While these pulsating treatment exposures, where units alternate between treatment and control, have received limited attention, I have recommended solutions for these settings and linked them in the comments.

There, the $post$ indicator from the standard DiD-setting is captured by the time fixed effect $\gamma_t$, and the $treatment$ indicator is captured by the unit fixed effect $\lambda_i$.

This is technically correct. The fixed effects will absorb each variable in isolation, but the treatment variable $D_{it}$ will remain. The classical difference-in-differences interaction term cannot be neatly estimated, as "post-treatment" is not well defined. Moreover, units can switch statuses over time, returning to the control group, which suggests fluid group membership.

In the case I described above, however, there is variation in the treatment indicator because one unit might be a treatment group for the first event, but can be a control group for the latter event.

No problem.

Let $D_{it}$ equal 1 whenever a unit is in a post-treatment period, 0 otherwise.

How is the TWFE model supposed to look like in such case?

The model should look very similar to the one you suggested. Simply add a parameter to $D_{it}$, and you have a generalization of the difference-in-differences estimator, like this:

$$ y_{it} = \lambda_i + \gamma_t + \delta D_{it} + u_{it}. $$

Should I just add the treatment indicator to the standard TWFE model like so $y_{it}=\gamma_t+\lambda_i+D_{it}+\mu_{it} + Treat_i$?

No.

The time-constant variable $Treat_i$ would be absorbed by the unit fixed effects in the model, making it impossible to estimate its effect separately. This is because the fixed effects already account for all time-invariant characteristics of the units, including treatment status, which is assumed to remain constant for each unit. In your setting, group membership (whether or not a unit is treated) is not well-defined over time, which adds to the confusion.

The key point is that in fixed effects models, the variation you’re trying to capture comes from within-unit (or within-group) changes over time. The product term you’re referring to—which captures the interaction between the unit and the time variable—is implicit in the way you code the treatment indicator $D_{it}$.

To clarify, $D_{it}$ is a binary variable that takes the value of 1 if the treatment is in effect for unit $i$ at time $t$, and 0 otherwise. This effectively captures the treatment effect without needing to explicitly define a product term or interaction term in the traditional sense. If a unit switches between treated and control conditions over time, $D_{it}$ can switch accordingly (from 1 to 0 or vice versa), reflecting these transitions within a unit(s). In this way, $D_{it}$ serves as the interaction term, encoding the time-varying treatment status for each unit (note the $i$- and $t$-subscripts), and it can also capture the reversal and resurgence of treatment over time.

$\endgroup$
9
  • $\begingroup$ Thanks for your help and answer. I get your arguments. However, I noticed that I made a small error in my original post. I asked whether I should add the treatment indicator $Treat_i$ to the regression. However, as the treatment assignment is time-varying, it is indeed $Treat_{i,t}$. Do your arguments then still hold? $\endgroup$
    – n_arch
    Commented Nov 18 at 19:37
  • $\begingroup$ Furthermore, could you clarify on the following: I tested both versions, so a generalized DiD regression like you suggested, and the same regression with a time-varying treatment indicator added to the equation. The coefficient of my DiD estimator changes drastically across both specifications. Why is the regression without additional time-varying treatment indicator more right, than the regression with additional treatment indicator? They are evidently not the same, because the results vary significantly. $\endgroup$
    – n_arch
    Commented Nov 18 at 19:39
  • $\begingroup$ Why are you adding $Treat_{it}$? Is this a different treatment? Is this the second event of treatment? Please clarify so I can help. $\endgroup$ Commented Nov 18 at 20:11
  • $\begingroup$ Yes, it essentially is a second treatment. The difference-in-difference design by Guest (2021), which I am refering to, uses the restructuring of the Wall Street Journal in 2007, 2008 and 2013. He combines all events in one DID regression. As a given unit can be treatment firm during the first event, control firm for the second event, and treatment firm for the third event, the treatment assignment is time varying; which is why I thought about adding the time-varying treatment indicator to the equation as it is not captured by the unit fixed effect. $\endgroup$
    – n_arch
    Commented Nov 18 at 20:24
  • $\begingroup$ I can send you the paper if you don't have access to get a better understanding of what the design looks like. $\endgroup$
    – n_arch
    Commented Nov 18 at 20:24

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.