Announcement

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

  • #31
    I got the latest version, which looks pretty good. I can't get the graph's to work (my names may be too long).

    I think I'd delete all the extra frames. If if fails for some reasons (in my case, the graph), then you've got a frame you have to delete to try again. With the key series stored, you don't need the extra frame.

    Comment


    • #32
      Do you mean for the multiple treatment setting? I may not even allow users to use the gr1opts or gr2opts for that setting, I'll think of another way to display those results in the many treated setup.

      Another possibility is the value labels. For example, if your value labels are "unusual" in that they have commas or slashes in it, what happens under the hood, should the users not specify a plot name, is the plot is named whatever the name of the unit is (i get rid of spaces internally). So, if you had something like "Area/51" as a value label, and didn't specify a plot name, Stata would read "name(Area/51)" which obviously isn't a legal name.

      On one hand, I could just delete all the special characters internally so users need not fiddle with it. I guess the utility of the frames, in my mind anyways, is so users can conveniently switch to them should they wish to customize the plot.

      Regarding the second point, you're right that r(series) sort of allows us to do this anyways, it's just not the first thing that comes to my mind when I wish to make a plot.

      Now that I test it though, I suppose it's no big deal to do

      Code:
      clear *
      
      net inst fdid, from("https://raw.githubusercontent.com/jgreathouse9/FDIDTutorial/main") replace
      
      net get fdid, all
      
      u "hcw.dta", clear
      
      fdid gdp, tr(treat) unitnames(state) gr1opts(name(area51))
      
      mkf newframe
      cwf newframe
      
      svmat r(series), names(col)
      So yeah, at minimum I won't have frames returned for the single unit case.

      I guess this also implies I'd need to do the same for the multi unit case. Then, I'd need to have everyone (the r(series) for each unit) under one roof instead of having their own frame, which I guess is a lot more convenient.



      EDIT: On my end, when I do

      Code:
      clear *
      
      //net inst fdid, from("https://raw.githubusercontent.com/jgreathouse9/FDIDTutorial/main") replace
      
      //net get fdid, all
      
      u "hcw.dta", clear
      
      fdid gdp, tr(treat) unitnames(state) gr1opts(name(area51))
      
      mkf newframe
      cwf newframe
      
      svmat r(series), names(col)
      
      
      frame dir
      i get
      Code:
      . frame dir
        default   1525 x 5; hcw.dta
      * newframe  61 x 5
      
      Note: Frames marked with * contain unsaved data.
      i think this is acceptable, so now I'm convinced I won't return frames, since r(series) does this already
      Last edited by Jared Greathouse; 18 Jul 2024, 14:15.

      Comment


      • #33
        Hey folks. I've updated FDID to have dynamic treatment effects. You now need sdid_event which does the dynamic effect estimation underneath the hood. The following code

        Code:
        clear * // We can leave comments in our code like this
        
        //qui net install sdid, from("https://raw.githubusercontent.com/daniel-pailanir/sdid/master") replace
        
        //qui net install sdid_event, from("https://raw.githubusercontent.com/DiegoCiccia/sdid/main/sdid_event") replace
        
        qui net install fdid, from("https://raw.githubusercontent.com/jgreathouse9/FDIDTutorial/main") replace
        
        
        use /// or we can leave comments like
        "https://github.com/jgreathouse9/FDIDTutorial/raw/main/basque.dta" // this
        
        
        //replace treat = 1 if year >= 1977 & id ==1
        
        cls
        fdid gdp, tr(treat) gr2opts(scheme(sj))
        
        
        mat l e(dyneff)
        will return a plot, and the matrix

        Code:
        e(dyneff)[43,6]
                    eff          se           t          lb          ub   eventtime
         r1   .09525491   .06420597   1.4835833  -.03058879    .2210986         -20
         r2    .0376283   .06935643   .54253519   -.0983103   .17356689         -19
         r3  -.02178299   .07831099  -.27816007  -.17527252   .13170655         -18
         r4  -.07416093   .07289722  -1.0173355  -.21703947   .06871761         -17
         r5  -.12586021   .06961974  -1.8078238  -.26231489   .01059448         -16
         r6  -.11593484   .02221342  -5.2191343  -.15947315  -.07239653         -15
         r7  -.10333084   .02510476  -4.1159854  -.15253618  -.05412551         -14
         r8  -.03988528   .02636319  -1.5129154  -.09155713   .01178658         -13
         r9   .00902916   .02156398   .41871479  -.03323624   .05129455         -12
        r10   .07958067   .02601194   3.0593896   .02859726   .13056408         -11
        r11    .1404568    .0261583   5.3694916   .08918653   .19172709         -10
        r12   .09779001   .01418968   6.8916302   .06997824   .12560177          -9
        r13   .05187453    .0005002   103.70759   .05089413   .05285492          -8
        r14   .05294526    .0066398   7.9739189   .03993125   .06595928          -7
        r15   .04530538   .01015128   4.4630203   .02540886   .06520189          -6
        r16  -.00168168   .02296847  -.07321687  -.04669988   .04333652          -5
        r17  -.03228008   .03663431  -.88114339  -.10408333   .03952317          -4
        r18  -.05484521   .05050494  -1.0859374  -.15383489   .04414447          -3
        r19  -.09019195   .05735261  -1.5725867  -.20260309   .02221917          -2
        r20   .05008901   .05346068   .93693179  -.05469392   .15487194          -1
        r21   .17473161   .04482815     3.89781   .08686844   .26259479           0
        r22  -.04327666   .00644079  -6.7191525  -.05590061  -.03065271           1
        r23  -.25507367   .05653924   -4.511445  -.36589056  -.14425676           2
        r24  -.52571046   .13121842  -4.0063772  -.78289855  -.26852235           3
        r25  -.68230855   .14602564  -4.6725254  -.96851879  -.39609829           4
        r26  -.80416667   .12720944  -6.3215961  -1.0534972  -.55483615           5
        r27  -.93612874    .0997607  -9.3837423  -1.1316597  -.74059772           6
        r28  -1.0055734   .10693021  -9.4040155  -1.2151566  -.79599017           7
        r29  -1.0742682   .11371927  -9.4466686   -1.297158  -.85137844           8
        r30  -1.0073231   .12422478  -8.1088743  -1.2508037  -.76384258           9
        r31  -.93580782   .13935384  -6.7153358  -1.2089413  -.66267431          10
        r32  -1.0101432   .10792504  -9.3596745  -1.2216762  -.79861009          11
        r33  -1.0687333   .07752095  -13.786381  -1.2206744  -.91679227          12
        r34  -1.1497821   .06552272  -17.547836  -1.2782066  -1.0213575          13
        r35  -1.2147638   .05381799  -22.571703  -1.3202471  -1.1092805          14
        r36  -1.1851293    .0359671  -32.950371  -1.2556248  -1.1146338          15
        r37  -1.1744176   .01314191  -89.364296  -1.2001758  -1.1486595          16
        r38  -1.1187197   .01782427  -62.763836  -1.1536553  -1.0837841          17
        r39  -1.0630208   .01899476   -55.96389  -1.1002506   -1.025791          18
        r40  -1.1122924    .0073423  -151.49109  -1.1266834  -1.0979015          19
        r41  -.99268401   .03221575  -30.813622  -1.0558269  -.92954111          20
        r42   -.9901849   .02665562  -37.147324  -1.0424299  -.93793988          21
        r43  -.95162451   .04596933  -20.701292  -1.0417244  -.86152464          22
        Now, we can visualize our treatment effects over time. I have not yet extended this to the multiple treated unit setting, though, as this would require estimating the intra-cohort covariance matrix and other theoretical considerations to estimate the dynamic effects across cohorts as a kind of a grand average. Either way, here it is. I'll update the vignette accordingly later on today.

        Comment


        • #34
          The paper describing FDID is on my GitHub. It describes the algorithm and the basic theory. It describes the syntax shows how to use it. Read it and give feedback, should you like, as it's currently but a draft.

          Comment

          Working...
          X