Dear All, I want to do the following:
Code:
local replace replace
forvalues i = 2007(1)2017 {
  forvalues j = `i'+1(1)2018 {     
  xi: reg einv epub_arimean_l100 $x o(`j').year ib`i'.year, robust
  outreg2 using "log\htwx21ene-t3", excel ctitle(`i'_`j') dec(4) `replace'
  local replace append
  }
}
More specifically, for i = 2007, I'd like to loop j from 2008 (i+1) to end 2018, for i = 2008, the loop of j goes from 2009 to the end 2018, and so on. The code does not work, and I wonder if anyone can help? Thanks.