Hi everyone,
I am running regressions for multiple y variables against multiple x variables. Trying to figure out the best way to automate exporting to Latex, so that the end results looks like the table below. That is, the columns are all the dependent variables, and the rows are different specifications stacked vertically.
The way I am doing it right now involves a lot of manual copy-pasting, which is repetitive and error-prone. I'm running the following code with -esttab-, and copying segments of the tex outputs ("x1.tex", "x2.tex") to a new tex file to construct the table above. Is there a way to directly construct the table though? I think maybe the trick is to use the -append- option, but can't figure out how exactly to do it. Any help would be greatly appreciated!
I am running regressions for multiple y variables against multiple x variables. Trying to figure out the best way to automate exporting to Latex, so that the end results looks like the table below. That is, the columns are all the dependent variables, and the rows are different specifications stacked vertically.
The way I am doing it right now involves a lot of manual copy-pasting, which is repetitive and error-prone. I'm running the following code with -esttab-, and copying segments of the tex outputs ("x1.tex", "x2.tex") to a new tex file to construct the table above. Is there a way to directly construct the table though? I think maybe the trick is to use the -append- option, but can't figure out how exactly to do it. Any help would be greatly appreciated!
Code:
sysuse auto, clear rename (weight length) (x1 x2) rename (price mpg headroom) (y1 y2 y3) local xlist x1 x2 local ylist y1 y2 y3 foreach x of local xlist { eststo clear foreach y of local ylist { eststo: reg `y' `x' } esttab using "`x'.tex", label booktabs not nonotes nonumber r2 replace }
Comment