Hello,

I have several dependent variables and am running a loop. The goal is to save the regression results in a LaTeX table. I need in this table to have the dependent variables d20_07_19 d30_07_19 d40_07_19 d50_07_19 d60_07_19 as headers in each column. For example:
d20_07_19 d30_07_19 d40_07_19 d50_07_19 d60_07_19
The problem is that in the way I run the loop I get tables appended one after the other. For example, first comes the result for d20_07_19. If I manually create the table as I need it, it will take me a lot of time. Do you know a way to produce the result I need in STATA? Below I attach the loop as I run it.

foreach y of varlist d20_07_19 d30_07_19 d40_07_19 d50_07_19 d60_07_19 {

eststo TR1_6_`y' : cgmreg `y' a b c d e f i.dcode, cluster(ccode dcode)

esttab TR1* using output_.1.tex, append b(3) se(3) ar2(3) ///
se star(^{*} 0.1 ^{**} 0.05 ^{***} 0.01) title(OLS regression estimates)
eststo clear
}