Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Lagging Diff-in-Diff coefficient

    Hi,

    I am trying to estimate an effect of legislation introduced in 2010 on companies (panel data) and I would like to see lagged effects of this legislation. I have control group and data before and after treatment so I am using Diff-in-Diff.

    My question is what is the proper method to do lags in a case of DD coefficient?
    My code:
    Code:
    gen Treat = 1 if EU == 1
    gen Time = 1 if year >= 2010
    mvencode Time Treat, mv(0)
    xtset company year
    xtreg y Treat##Time i.year, fe
    I know I can use lagged time variables within Stata (L., L2., ...), but the problem is that using this method I always use one year - lagging does that, even though it would be suitable for me to use zeros to the missing last year... Therefore I can adjust my coefficient manually:
    Code:
    gen TimeLag = 1 if year >=2011
    gen TimeLag2 = 1 if year >= 2012
    gen TimeLag3 = 1 if year >= 2013
    mvencode TimeLag*, mv(0)
    xtreg y Treat##TimeLag i.year, fe
    But then I struggle with how to implement more lags in the regression and what would the interpretation be afterwards...
    Whether the proper solution would be to put all of those together or include one regression for each time lag:
    Code:
    xtreg y Treat##TimeLag Treat##TimeLag2 Treat##TimeLag3 i.year, fe
    Or:
    Code:
    xtreg y Treat##TimeLag i.year, fe
    xtreg y Treat##TimeLag2 i.year, fe
    xtreg y Treat##TimeLag3 i.year, fe
    Thank you so much in advance

    Vojtech

  • #2
    You'll increase your chances of a useful answer by following the FAQ on asking questions - provide Stata code in code delimiters, readable Stata output, and sample data using dataex. You may also want to cut your post down to the minimum necessary. Without a better understanding of your data, it is hard to know what you're doing.

    I can say that if you want to estimate lags, you probably need to include the shorter lags when you estimate longer lags. But, the issue is not exactly the year, it is when the treatment occurred and I'm not sure that what you've done handles this correctly. You're not lagging Treat, so you're interacting Treat in year t with whether the Treat in another year is positive. I also don't understand the structure of the lags - they seem to be future not past.

    Try setting with up more directly.

    Comment


    • #3
      Dear Phil,

      thank you very much for your answer. I am sorry that I did not follow all the guidelines, however I cannot share the data (as I do not have rights for it)... I have tried to use code delimiters, hope it works, otherwise I do not know what to do. And definitely I need to be more straighforward.

      Anyone, what I understood from your comment is that shorter lags are needed all the time which is a valuable impact for me. However I struggle with understanding of the rest of the comment - what do you mean by "the issue is ... when the treatment occured..."? If I lag treatment (also if I would use Stata L., L2., ...) that would just move it in time, isn't that right?

      The structure in my original comment is wrong, sorry for that... Of course it needs to be past.

      Thank you for your help

      Vojtech

      Comment

      Working...
      X