to speed up the code, I would like to export results to a file for every 10 regressions. Is it possible to do something like the following?
forvalues i = 1(1)20{
ppmlhdfe y ${varlist`i'}, absorb(year) cluster(year)
estimates store result`i'
if mod(`i', 10) == 0 {
outreg2 result* using "$outputdir1\results.csv"
est clear
}
}
In this pseudo-code, I mean that we save results for every 10 regressions, and clear the estimations in memory move on to the next 10 regressions. Is it possible in Stata?