Announcement

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

  • #31
    Hi Daniel,
    I am trying to implement SDID for a USA Census tract-level dataset (around 72K observations) that has about 4100 treated (staggered, binary) observations with 11 years (11*72000 obs years). I did download SDID from Github as you suggest. I ran one regression and it took closer to 72 hours to get results. Does this sound like a reasonable time to run SDID for this many observations? Thank you in advance for any replies.

    Comment


    • #32
      Dear Daniel PV, the treatment effect you illustrated above is amazing! For my case which the panel has 12 periods as well but 275 cities, if to plot the treatment effect graph from sdid, to get something similar that you answered in thread #23, can I edit the code like below :

      Thanks in advance!
      Meng

      [QUOTE=Daniel PV;n1675942]Hi Joe Zonda, I think I have an answer to that. You must execute the sdid command, as many times as post treatment times... I recommend you use a loop.

      Code:
      *ignore webuse code
      matrix mycase = J(12,275,.) //create an matrix to hold the results
      
      local j=1
      forval t=2008(1)2019 {
      sdid y state year treated if year<=2019 | year==`t', vce(placebo) seed(1213) reps(100)
      
      *save tau and lower and upper bound
      local tau=e(tau)[1,1]
      local se=e(se)
      local lci=`tau'+invnormal(0.025)*`se'
      local uci=`tau'+invnormal(0.975)*`se'
      matrix tau_prop99[`j',1]=`tau'
      matrix tau_prop99[`j',2]=`lci' //should the lower bound here be 2 as well?
      matrix tau_prop99[`j',12]=`uci' //should the upper bound here be 12?
      local ++j 
      }
      
      *However, at this step I got error "invalid syntax" after I got the sdid estimator
      
      matlist mycase
      matrix coln tau_mycase=tau lower upper
      clear
      svmat tau_mycase, n(col)
      gen year=_n+2008 //define the time variable for the graph
      
      #delimit ;
      tw line tau year, || rcap lower upper year || scatter tau year, mc(black) ||
      , yline(0,lc(balck%50) lp(dash)) legend(off) ytitle("Treatment effect by year")
      xtitle("") xlabel(2008(1)2019) ylabel(-50(10)20) scheme(gg_tableau);
      graph export mycase.eps, replace;
      #delimit cr


      Comment

      Working...
      X