Hello everyone, I have a question about esttab command in a loop and getting the entire output in an excel file. So my command goes like this:

local name2 "shg_new shgs drain water_source water_supply education health icds irrigation market road waste_manage tubewell grant_received opening_bal closing_bal"

foreach name2 in shg_new shgs drain water_source water_supply education ///
health icds irrigation market road waste_manage tubewell ///
grant_received opening_bal closing_bal {
bysort year: eststo: estpost ttest `name2', by(cpgender) unequal
esttab using summarystat.csv, wide append
}

The issue is that the output table in the excel file is only for one year. The remaining years do not get compiled in the excel file. Is there something wrong with my command? Kindly help.