0
$\begingroup$

I have a question regarding the question here. In @Thomas Bilach answer, he gives the following example, which I have edited a bit more to add my own hypothetical examples:

$$ \begin{array}{ccc} item & day & D_{it} & D_{it}^{-3} & D_{it}^{-2} & D_{it}^{-1} & D_{it}^{0} & D_{it}^{+1} & D_{it}^{+2} & D_{it}^{+3} \\ \hline 1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 1 & 2 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 1 & 3 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 1 & 4 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 1 & 5 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 1 & 6 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 1 & 7 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 1 & 8 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ \hline 2 & 1 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\ 2 & 2 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\ 2 & 3 & 1 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\ 2 & 4 & 1 & 0 & 0 & 0 & 0 & 1 & 0 & 0 \\ 2 & 5 & 1 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \\ 2 & 6 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 (?) \\ 2 & 7 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 2 & 8 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ \hline 3 & 1 & 0 & 1 (?) & 0 & 0 & 0 & 0 & 0 & 0 \\ 3 & 2 & 0 & 0 & 1 (?) & 0 & 0 & 0 & 0 & 0 \\ 3 & 3 & 0 & 0 & 0 & 1 (?) & 0 & 0 & 0 & 0 \\ 3 & 4 & 1 & 1 (?) & 0 & 0 & 1 (?) & 0 & 0 & 0 \\ 3 & 5 & 1 & 0 & 1 (?) & 0 & 0 & 1 (?) & 0 & 0 \\ 3 & 6 & 0 & 0 & 0 & 1 (?) & 0 & 0 & 0 (?) & 0 \\ 3 & 7 & 1 & 0 & 0 & 0 & 1 (?) & 0 & 0 & 1 (?) \\ 3 & 8 & 1 & 0 & 0 & 0 & 0 & 1 (?) & 0 & 0 \\ \hline 4 & 1 & 1 & & & & & & & \\ 4 & 2 & 1 & & & & & & & \\ 4 & 3 & 1 & & & & & & & \\ 4 & 4 & 1 & & & & & & & \\ 4 & 5 & 1 & & & & & & & \\ 4 & 6 & 1 & & & & & & & \\ 4 & 7 & 1 & & & & & & & \\ 4 & 8 & 1 & & & & & & & \\ \hline 5 & 1 & 1 & & & & & & & \\ 5 & 2 & 1 & & & & & & & \\ 5 & 3 & 1 & & & & & & & \\ 5 & 4 & 0 & & & & & & & \\ 5 & 5 & 0 & & & & & & & \\ 5 & 6 & 0 & & & & & & & \\ 5 & 7 & 0 & & & & & & & \\ 5 & 8 & 0 & & & & & & & \\ \end{array} $$

In particular, item 4 is always treated (before day 1 even begins). Item 5 is already treated (before day 1 begins) but switches off from day 4 onwards.

My objective is to estimate a dynamic version of the above difference in difference in the spirit of @Thomas Bilach answer here. However, I am having trouble with this in the context where treatment switches on and off. It is easy in the classical difference in difference where treatment stays on, but I am unsure how to manually create the dynamic dummy variables in the above example.

To get started, $D_{it}^{-3}$ denotes the treatment effect 3 days before the treatment event day. The other dummies are defined similarly. I've tried my best to fill in the values, but anything with a $(?)$ next to it, I am unsure whether I filled in the correct value. Take, for example, item 2 on day 6, if treatment on day 3 was permanent, then clearly $D_{it}^{+3}=1$, but because item 2 switches off on day 6, then should $D_{it}^{+3}$ be set to $0$? Similarly, item 3 causes me a lot of confusion, since it enters treatment on day 4, switches off on day 6, but enters treatment again on day 7. How do I define the dynamic dummies then?

Items 4 and 5, I have no idea how to set the dummies.

$\endgroup$
2
  • $\begingroup$ Do you have a lot of units where they switch back and forth between the treatment and control condition? $\endgroup$ Commented Mar 18, 2023 at 4:57
  • $\begingroup$ Yes, quite a lot of observations switch back and forth... $\endgroup$
    – TeTs
    Commented Mar 23, 2023 at 5:05

0

Your Answer

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