I am trying to do something like this:
Code:
local group1 var1 var2 var3 local group2 var4 var5 var6 local group3 var7 var8 var9 foreach v in `group1' `group2' `group3' { sum `v' if year==1 sum `v' if year==2 }
I, however, would like to export the stats in a .csv file using eststo/esttab command. I went for something like this:
Code:
local group1 var1 var2 var3 local group2 var4 var5 var6 local group3 var7 var8 var9 foreach v in `group1' `group2' `group3' { eststo: sum `v' if year==1 esttab using "table.csv", stats(mean sd) title("Summary Statistics") replace }
I'd really appreciate your help on this.
Thanks a lot!
0 Response to Summary statistics using eststo/esttab in a loop
Post a Comment