Announcement

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

  • #16
    Dear @Jesse Wur,

    It was as you said, I had a few duplicates under a certain type of ID (cusip) but once I switched to another one (gvkey) the issue disappeared. I was able to reshape my dataset to wide but

    Comment


    • #17
      Dear Jesse Wursten ,

      It was as you said, I had a few duplicates under a certain type of ID (cusip) but once I switched to another one (gvkey) the issue disappeared. I was able to reshape my dataset to wide but when dealing with 20+ years, I am having a difficult time figuring out how to use the codes for my panel dataset because my treatment effects were administered at different years. Is it a necessary condition for me to reshape it to Wide format or can I still perform DID inference on a Long format?

      For example, ID 111 received a treatment in year 2000, and they also received a treatment in year 2003. However, ID 555 received their treatment in 2005 only. In my panel dataset I have over 50,000 observations.

      So my question is, after I have I reshaped it to wide format, should I run the teffects code for each individual year?

      1. teffects nnmatch (Dependent2000 X12000, X22000) (Treatment2000), ematch(sic200),.......

      2. teffects nnmatch (Dependent 2001 X12001 X22001) (Treatment2001), ematch(sic201)..........

      3. 2002, 2003... 2017,



      If that would prove to be too complicated for my kind of panel data set-up, where treatment occurs at random years, then is there any way to proceed with a long dataset?



      In the past I have successfully managed to use the user created nnmatch formula which automatically drops observations that don't have exact matches. The only problem is that it takes 6-7+ hours to complete:

      Code:
      nnmatch Dependent Treatment X1 X2, exact(sic fyear) bias(X1 X2) keep(nnmatch)

      Also just for reference, is there any way to store the matching results for teffects just like there is for the user nnmatch code?



      Dataset structure (long):
      ID Year Income Treat
      111 2000 10 1
      111 2001 40 0
      111 2002 90 0
      111 2003 100 1
      111 2004 120 0
      111 2005 190 0
      333 2000 10 1
      333 2001 45 1
      333 2002 90 0
      333 2003 110 1
      333 2004 160 0
      333 2005 240 1
      333 2006 290 0
      333 2007 380 0
      555 2000 10 0
      555 2001 20 1
      555 2002 85 0
      555 2003 195 0
      555 2004 215 0

      Comment


      • #18
        The dataset being in wide or long format should not have an effect on whether it matters that the treatments happen in different time periods. At this point, it can be useful to think long and hard on what exactly you want to and how that translates into matrices of data. For info on created the matched sample, see this article.

        Comment


        • #19
          Tahseen,
          Does your code
          Code:
           
           nnmatch Dependent Treatment X1 X2, exact(sic fyear) bias(X1 X2) keep(nnmatch)
          spit out the control firms identity? If not, how can we get the control firms?

          Comment

          Working...
          X