I am currently running, let's just say 400 variations of, esttab command (from estout SSC; I use Stata 16) to make output for .tex files and I would like to automate naming the using filename.tex. For example:
Code:
est clear eststo: reg y1 x1a x2 x3, robust eststo: reg y1 x1a x2 x3, robust eststo: reg y1 x1a x2 x3, robust esttab using filename001.tex, replace eststo: reg y1 x1b x2 x3, robust eststo: reg y1 x1b x2 x3, robust eststo: reg y1 x1b x2 x3, robust esttab using filename002.tex, replace eststo: reg y1 x1c x2 x3, robust eststo: reg y1 x1c x2 x3, robust eststo: reg y1 x1c x2 x3, robust esttab using filename003.tex, replace eststo: reg y2 x1a x2 x3, robust eststo: reg y2 x1a x2 x3, robust eststo: reg y2 x1a x2 x3, robust esttab using filename004.tex, replace eststo: reg y2 x1b x2 x3, robust eststo: reg y2 x1b x2 x3, robust eststo: reg y2 x1b x2 x3, robust esttab using filename005.tex, replace eststo: reg y2 x1c x2 x3, robust eststo: reg y2 x1c x2 x3, robust eststo: reg y2 x1c x2 x3, robust esttab using filename006.tex, replace eststo: reg y3 x1a x2 x3, robust eststo: reg y3 x1a x2 x3, robust eststo: reg y3 x1a x2 x3, robust esttab using filename007.tex, replace eststo: reg y3 x1b x2 x3, robust eststo: reg y3 x1b x2 x3, robust eststo: reg y3 x1b x2 x3, robust esttab using filename008.tex, replace eststo: reg y3 x1c x2 x3, robust eststo: reg y3 x1c x2 x3, robust eststo: reg y3 x1c x2 x3, robust esttab using filename009.tex, replace
Code:
local numlist 1/400 <loop sequence here> 1. ... 2. ... 3. ... 4. ... 5. esttab using filename`numlist'.tex, replace
Best,
Nampuna
0 Response to How to automate output file names for multiple esttab command?
Post a Comment