Announcement

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

  • Yes and no....
    you need to use option `long2' to get estimates for pretreatment that are comparable to standard Event studies program
    csdid y x, ..... long2

    Aftert that, csdid_plot will produce a graph with a cap at T-1. But, the gap will be empty.
    HTH

    Comment


    • Hmmm, that plot was produced after running the csdid command with the long2 option, but didn't produce a gap at T-1. I guess I'll just create it in excel.

      Comment


      • can you show me what you get if you use the following code;
        Code:
        ssc install frause
        frause mpdta, clear
        csdid lemp, ivar( countyreal) time(year) gvar(first) long2
        estat event
        For me it produces this:
        Code:
        ------------------------------------------------------------------------------
                     | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
        -------------+----------------------------------------------------------------
             Pre_avg |   .0175956   .0169201     1.04   0.298    -.0155672    .0507585
            Post_avg |  -.0772398    .019965    -3.87   0.000    -.1163705   -.0381092
                 Tm4 |   .0033064   .0244519     0.14   0.892    -.0446184    .0512311
                 Tm3 |   .0250218   .0181189     1.38   0.167    -.0104906    .0605343
                 Tm2 |   .0244587   .0142364     1.72   0.086    -.0034441    .0523616
                 Tp0 |  -.0199318   .0118264    -1.69   0.092    -.0431111    .0032474
                 Tp1 |  -.0509574   .0168935    -3.02   0.003     -.084068   -.0178468
                 Tp2 |  -.1372587   .0364357    -3.77   0.000    -.2086713   -.0658461
                 Tp3 |  -.1008114   .0343592    -2.93   0.003    -.1681542   -.0334685
        ------------------------------------------------------------------------------
        If you get something else, you may need to update your csdid and drdid files.

        Comment


        • Here's my code:
          Code:
          csdid PQI90r PercentUnemployed PercentBelowPoverty [iweight=att_wt1], ivar(hsanum) t(YEAR) gvar(y_start) method(dripw) long2
          estat event
          For me it produces this:
          Code:
          ATT by Periods Before and After treatment
          Event Study: Dynamic effects
          ------------------------------------------------------------------------------
                       | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
          -------------+----------------------------------------------------------------
               Pre_avg |  -6.700665   45.24749    -0.15   0.882    -95.38412    81.98279
              Post_avg |  -27.61554   24.64424    -1.12   0.262    -75.91736    20.68629
                   Tm4 |   -47.4056   78.09454    -0.61   0.544    -200.4681    105.6569
                   Tm3 |   5.415585   71.28649     0.08   0.939    -134.3034    145.1345
                   Tm2 |   11.29903   44.29723     0.26   0.799    -75.52195       98.12
                   Tm1 |   3.888325   23.92913     0.16   0.871     -43.0119    50.78855
                   Tp0 |  -34.43216   17.09996    -2.01   0.044    -67.94746   -.9168607
                   Tp1 |  -11.13073   25.41266    -0.44   0.661    -60.93862    38.67716
                   Tp2 |  -41.11549   28.36162    -1.45   0.147    -96.70324    14.47226
                   Tp3 |  -23.78376   60.03834    -0.40   0.692    -141.4567    93.88922
          ------------------------------------------------------------------------------

          Comment


          • Ok try updating csdid
            or at least verify its version 1.7 or higher

            Comment


            • How do I one sided test with csdid?
              For instance, suppose I run
              use https://friosavila.github.io/playing...rdid/mpdta.dta, clear
              csdid lemp lpop , ivar(countyreal) time(year) gvar(first_treat) agg(event)
              How do I compute, for instance, then likelihood that Tm3 is less than or equal to -0.2?
              I saw https://www.stata.com/support/faqs/s...-coefficients/
              However, those instruction require r(df_r) and r(F) which are not saved by csdid.

              Comment


              • Just think of the coefficients as a regular regression. Use test or Lincoln to construct the modified coefficient and then evaluate it using z score appropriate for your case

                Comment


                • Ok, thanks!

                  Comment




                  • Hello,

                    Im also experiencing a similar problem, csdid_plot is not producing a T-1 gap for me, the coefficients are corresponding to -1,-2,-3 periods to treatment when they should be corresponding to -2,-3,-4.

                    Here is the code I used:

                    Code:
                    * load the dataset
                    use "$temp/Master enterprise dataset collapsed at ward year with 1999.dta", clear
                    
                    * tell csdid what control units to use
                    replace sezyear=0 if sezyear>= 2013 & sezyear<=2016 
                    
                    * DiD estimation using notyet option
                    csdid empend, ivar(wardnew) time(year) gvar(sezyear) long2 notyet
                    
                    * creates and exports a plot for g2003 estimates using notyet option 
                    qui: csdid_estat attgt 
                    
                    csdid_plot, group(2003) title("Group 2003") style(rcap) legend(label(1 "95% CI") label(2 "Pre-Treatment Coefficient") label(3 "95% CI") label(4 "Post-Treatment Coefficient") region(lstyle(foreground)) rows(2) position(6))
                    Here is the graph (pdf):

                    2003_c_notyet.pdf

                    Please could you advise me on how I may fix this? Thanks.



                    Comment


                    • When using estat event after my estimation the following comes up, however I'm not doing a graph for this output (in this output the T-1 Gap is produced, but not produced in the group output when graphing)


                      Code:
                      . estat event
                      ATT by Periods Before and After treatment
                      Event Study:Dynamic effects
                      ------------------------------------------------------------------------------
                                   | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
                      -------------+----------------------------------------------------------------
                           Pre_avg |  -229.2279   79.55591    -2.88   0.004    -385.1546   -73.30118
                          Post_avg |   2456.201   394.1057     6.23   0.000     1683.768    3228.634
                               Tm9 |   -203.825   195.1824    -1.04   0.296    -586.3756    178.7256
                               Tm8 |  -166.2542   107.5019    -1.55   0.122     -376.954    44.44556
                               Tm7 |  -301.1865   129.5201    -2.33   0.020    -555.0412    -47.3319
                               Tm6 |  -294.5734   107.8697    -2.73   0.006    -505.9942   -83.15266
                               Tm5 |   -289.259   96.66711    -2.99   0.003    -478.7231   -99.79495
                               Tm4 |  -239.7188   72.90645    -3.29   0.001    -382.6128    -96.8248
                               Tm3 |   -182.408   56.02195    -3.26   0.001     -292.209   -72.60701
                               Tm2 |  -156.5981   38.59177    -4.06   0.000    -232.2366   -80.95963
                               Tp0 |   163.4253   57.88782     2.82   0.005     49.96722    276.8833
                               Tp1 |   401.6088   95.38017     4.21   0.000     214.6671    588.5505
                               Tp2 |   650.5233   147.7758     4.40   0.000     360.8881    940.1584
                               Tp3 |   984.8339   172.5349     5.71   0.000     646.6717    1322.996
                               Tp4 |   1426.346   221.2178     6.45   0.000     992.7673    1859.925
                               Tp5 |   2661.896    390.341     6.82   0.000     1896.842     3426.95
                               Tp6 |   4068.035   648.1162     6.28   0.000      2797.75    5338.319
                               Tp7 |   4065.451   749.7587     5.42   0.000     2595.951    5534.951
                               Tp8 |   4867.701   983.8101     4.95   0.000     2939.469    6795.934
                               Tp9 |   5272.187   1544.767     3.41   0.001     2244.498    8299.875
                      ------------------------------------------------------------------------------

                      Comment


                      • Oh ok
                        i think I understand the problem
                        you are trying to produce an event like plot using a single cohort

                        i will have to modify the code for that. But so not have a date for the update. Your other alternative is to use csdid2.
                        please see my personal website and repository and contact me if you need help producing the event like plots

                        will try to post an example here tomorrow
                        Fernando

                        Comment


                        • Perfect thank you!

                          Comment


                          • Here is the code
                            Code:
                            net install csdid2, from(https://friosavila.github.io/stpackages)
                            ssc install frause
                            frause mpdta, clear
                            ** No need for long2, because its the default
                            csdid2 lemp, ivar(county) time(year) gvar(first)  
                            estat event, rgroup(2007) plot
                            HTH

                            Comment


                            • Thank you Fernando, this code solved my issue.

                              Follow up question: in my previous code for csdid_plot I had plot options which look like this:

                              Code:
                              csdid_plot, group(2003) title("Group 2003") style(rcap) legend(label(1 "95% CI") label(2 "Pre-Treatment Coefficient") label(3 "95% CI") label(4 "Post-Treatment Coefficient") region(lstyle(foreground)) rows(2) position(6))
                              How can I implement these options using this approach?

                              Thanks,
                              Jad

                              Comment


                              • Hello Fernando, please disregard the above message, I was able to figure out how to implement these options by using the following code after the csdid2 estimation:

                                Code:
                                qui: estat event, rgroup(2007)
                                
                                csdid2_plot, title("Group 2007") style(rcap) legend(label(1 "95% CI") label(2 "Pre-Treatment Coefficient") label(3 "95% CI") label(4 "Post-Treatment Coefficient") region(lstyle(foreground)) rows(2) position(6))
                                Thank you so much for your help, I appreciate this greatly!

                                Comment

                                Working...
                                X