Hello,

I have a question regarding exporting the Stata table using outreg2. The following is my code:

foreach var in s109c2 s109c1a s109c1b s109c1c s109c1d s109c1e s109c1f s765t s765ba s765bb s765bc s765bd s765be s765bf diff_gr {


reg `var' rv treatment treat_rv if rv<35 & rv>=-35, r
outreg2 using "Table1.xls", replace nocons bdec(3) se ctitle("Linear RD, 1984-1989") keep (treatment) label

reg `var' rv treatment treat_rv if rv<47 & rv>=-48, r
outreg2 using "Table1.xls", append nocons bdec(3) se ctitle("Linear RD, 1983-1990") keep (treatment) label

reg `var' rv treatment treat_rv if rv<59 & rv>=-60, r
outreg2 using "Table1.xls", append nocons bdec(3) se ctitle("Linear RD, 1982-1991") keep (treatment) label

reg `var' rv treatment treat_rv if rv<83 & rv>=-84, r
outreg2 using "Table1.xls", append nocons bdec(3) se ctitle("Linear RD, 1980-1993") keep (treatment) label


}

But I do not get RDD coefficient for each variable in a different row after this. Just one variable. My question is, how can I export table with a row lable of each variable reporting the coefficient of treatment only, without mentioning treatment in the table? In general, do you have any suggestions for exporting this code to Excel? I'm stuck here. Thanks in advance.