I have a bunch of datasets in the same folder and I would like to run the very same regression for every dataset. Also, I would like to export the respective regression output in .tex format for every dataset. This is what I tried:
ssc inst fs, replace
fs *.dta
foreach f in `r(files)' {
use "`f'"
local newname : subinstr local f ".dta" ".tex"
reghdfe y x1 x2 x3, absorb(fe1 fe2) cluster(fe1 fe2)
outreg2 using `newname', replace ctitle ((1)) addtext(fe1, YES, fe2, YES) adjr2
}
I get the error invalid 'Export'. The regression is run, but it seems the outreg2 is not working. I don't see my mistake, who can help?