Announcement

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

  • Staggerd Events - Difference in difference

    Dear all,
    I have a panel dataset containing panel var (gvkey – firm identifier), time var (fyear, fiscal year), x (main variable), event (a dummy, =1 if an event occurs in that year for that firm).

    You can see that for gvkey 1000, it has 2 events staggered in 2000 and 2002.

    [CODE]
    | gvkey fyear ap event f1_ap l1_ap d1_ap |
    |----------------------------------------------------|
    1. | 1000 1999 10 0 20 . . |
    2. | 1000 2000 20 1 15 10 5 |
    3. | 1000 2001 15 0 10 20 -10 |
    4. | 1000 2002 10 1 . 15 . |
    5. | 1001 1999 12 0 22 . . |
    |----------------------------------------------------|
    6. | 1001 2000 22 1 15 12 3 |
    7. | 1001 2001 15 0 43 22 21 |
    8. | 1001 2002 43 0 . 15 . |
    +----------------------------------------------------+

    . clear

    . import excel "C:\Edrive\Stata Learning\Stagger Events\New Microsoft Excel Worksheet.xlsx", sheet("Test change AP = did") firstrow

    . dataex

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input int(gvkey fyear) byte(x event)
    1000 1999 10 0 
    1000 2000 20 1 
    1000 2001 15 0 
    1000 2002 10 1 
    1001 1999 12 0 
    1001 2000 22 1 
    1001 2001 15 0 
    1001 2002 43 0 
    1002 2000 15 0 
    1002 2001 10 0 
    end
    I will conduct a Difference in difference (DID) regression analysis.
    The basic DID we need to have a treat dummy and a post dummy.
    My question concerns how to generate the post dummy :
    • For gvkey 1000,if post=1 for years following event, i.e. 2000, 2001, 2002, 2003, how do I reset post for the second event in year 2002 ,
    See desired output

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input int(gvkey fyear) byte(x event post)
    1000 1999 10 0 0 
    1000 2000 20 1 1 
    1000 2001 15 0 1 
    1000 2002 10 1 0 
    1000 2003 5 0 1 
    1001 1999 12 0 0 
    1001 2000 22 1 0 
    1001 2001 15 0 1 
    1001 2002 43 0 1 
    1002 2000 15 0 0 
    1002 2001 10 0 0 
    end
    p.s. if you know about staggered events, please comment on if I should reset post to 0 when encountering second events.

    Thanks,

    Rochelle

  • #2
    My post #1 has some errors, I apologize, let me repost , I hope to get some help

    I have a panel dataset containing panel var (gvkey – firm identifier), time var (fyear, fiscal year), x (main variable), event (a dummy, =1 if an event occurs in that year for that firm).

    You can see that for gvkey 1000, it has 2 events staggered in 2000 and 2002.

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input int(gvkey fyear) byte(x event)
    1000 1999 10 0 
    1000 2000 20 1 
    1000 2001 15 0 
    1000 2002 10 1 
    1001 1999 12 0 
    1001 2000 22 1 
    1001 2001 15 0 
    1001 2002 43 0 
    1002 2000 15 0 
    1002 2001 10 0 
    end
    I will conduct a Difference in difference (DID) regression analysis.
    The basic DID we need to have a treat dummy and a post dummy.
    My question concerns how to generate the post dummy :
    • For gvkey 1000,if post=1 for years following event, i.e. 2000, 2001, 2002, 2003, how do I reset post for the second event in year 2002 ,
    See desired output
    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input int(gvkey fyear) byte(x event post)
    1000 1999 10 0 0 
    1000 2000 20 1 1 
    1000 2001 15 0 1 
    1000 2002 10 1 0 
    1000 2003 5 0 1 
    1001 1999 12 0 0 
    1001 2000 22 1 0 
    1001 2001 15 0 1 
    1001 2002 43 0 1 
    1002 2000 15 0 0 
    1002 2001 10 0 0 
    end
    Thanks,

    R

    Comment


    • #3
      When you have multiple events, you cannot really do a difference-in-differences analysis. And the situation raises a large number of complications for designing a study. The effect of a second event might well be different from the effect of a first event. And how different it is might well depend on the amount of time elapsed between the two events.

      Then there is the issue of assigning the post variable in the control group that has no events at all. And can a firm that experiences one event be a "control" for a firm that has two?

      These are important design questions that you must resolve before writing code. You should do a careful literature search to see how others have handled this situation as it may provide you with a deeper understanding of how multiple events interact with each other, enabling you to arrive at a better analysis plan.

      Comment

      Working...
      X