Announcement

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

  • ATT of did_imputation by Borusyak et al. 2021

    I know in case of csdid if I run the following regression then I'll get the ATT.
    Code:
    
    csdid ln_wage, ivar(county) time(year) gvar(policy_year) agg(event)
    estat simple
    
    estat simple
    Average Treatment Effect on Treated
    ------------------------------------------------------------------------------
                 | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
    -------------+----------------------------------------------------------------
             ATT |  -.0033592     .00675    -0.50   0.619    -.0165889    .0098706
    ------------------------------------------------------------------------------


    However, I have tried several methods to find the ATT like the one I get in CSDID when I apply the did_imputation but I've not been successful to do so. Would you kindly guide me how I can end up getting the ATT in case of did_imputation ?

    Code:
    ssc install did_imputation, replace
    
    did_imputation ln_wage county year policy_year, autosample horizons(0/5) pretrend(5) minn(0)

    Would really appreciate your valuable input!

  • #2
    I don't understand the problem.

    Comment


    • #3
      If I run the following command

      Code:
      did_imputation ln_wage county year policy_year, autosample horizons(0/5) pretrend(5) minn(0)
      I get a table like this , but not the ATT.

      Code:
                                                              Number of obs = 66,581
      ------------------------------------------------------------------------------
            ln_emp | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
      -------------+----------------------------------------------------------------
              tau0 |   .0078529   .0141983     0.55   0.580    -.0199752     .035681
              tau1 |    .006906    .016485     0.42   0.675     -.025404     .039216
              tau2 |   .0077604   .0177336     0.44   0.662    -.0269969    .0425177
              tau3 |   .0109745   .0188022     0.58   0.559    -.0258772    .0478262
              tau4 |   .0189137   .0193346     0.98   0.328    -.0189815    .0568089
              tau5 |   .0392954   .0212797     1.85   0.065    -.0024121    .0810029
              pre1 |  -.0002982    .018568    -0.02   0.987    -.0366908    .0360944
              pre2 |   .0187492   .0167825     1.12   0.264    -.0141438    .0516423
              pre3 |   .0071949   .0164604     0.44   0.662     -.025067    .0394567
              pre4 |   .0061025    .014488     0.42   0.674    -.0222935    .0344984
      My question is with did_imputation command of Borusyak et al. (2021) how can I get the ATT like the one CSDID of Calaaway and Sant'Anna provides like the following

      Code:
      csdid ln_wage, ivar(county) time(year) gvar(policy_year) agg(event)
      estat simple
      
      Average Treatment Effect on Treated
      ------------------------------------------------------------------------------
                   | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
      -------------+----------------------------------------------------------------
               ATT |   -.008374   .0208924    -0.40   0.689    -.0493223    .0325743

      Comment


      • #4
        Note that I've not used this estimator, and I do think it's pretty silly the authors didn't make this a scalar, but this is what I've tried
        Code:
        clear *
        timer clear
        set seed 10
        global T = 15
        global I = 300
        
        set obs `=$I*$T'
        gen i = int((_n-1)/$T )+1                     // unit id
        gen t = mod((_n-1),$T )+1                    // calendar period
        tsset i t
        
        // Randomly generate treatment rollout years uniformly across Ei=10..16 (note that periods t>=16 would not be useful since all units are treated by then)
        gen Ei = ceil(runiform()*7)+$T -6 if t==1    // year when unit is first treated
        bys i (t): replace Ei = Ei[1]
        gen K = t-Ei                                 // "relative time", i.e. the number periods since treated (could be missing if never-treated)
        gen D = K>=0 & Ei!=.                         // treatment indicator
        
        // Generate the outcome with parallel trends and heterogeneous treatment effects
        gen tau = cond(D==1, (t-12.5), 0)             // heterogeneous treatment effects (in this case vary over calendar periods)
        gen eps = rnormal()                            // error term
        gen Y = i + 3*t + tau*D + eps                 // the outcome (FEs play no role since all methods control for them)
        //save five_estimators_data, replace
        cls
        // Estimation with did_imputation of Borusyak et al. (2021)
        did_imputation Y i t Ei, allhorizons pretrend(5)
        
        su tau if tau ~= 0

        Comment

        Working...
        X