Exporting Tabstat in Stata

Ahmed Arif picture Ahmed Arif · Dec 28, 2016 · Viewed 10k times · Source

I am trying to export tabstat result from stata. I am using following commands.

estpost tabstat x1 x2 x3 x4, by(country)
estout using Data\summary.csv

However, when I open the CSV file, I only find

country
b

in the CSV file. Please let me know if there is something wrong in the commands I am using.

Answer

Eric HB picture Eric HB · Dec 28, 2016

Answer coming from: http://repec.org/bocode/e/estout/estpost.html#estpost101b

by country: eststo: quietly estpost summarize x1 x2 x3 x4, listwise
esttab using summary.csv, cells("mean") label nodepvar

You can add different summary stats to cells, for example: cells("mean sd min max") would show the mean, standard deviation, minimum, and maximum for each x in each country.

Hope this helps