Quantcast
Channel: The Stata Blog - Latest Comments
Viewing all articles
Browse latest Browse all 1129

Re: Export tables to Excel

$
0
0

You can use if with tabstat to get the results you want.

sysuse auto, clear
by for: tabstat mpg
tabstat mpg if for == 0, save
matrix a = r(StatTotal)
putexcel A1=(a) ...
tabstat mpg if for == 1, save
matrix a = r(StatTotal) ...
putexcel A4=(a)

Viewing all articles
Browse latest Browse all 1129

Trending Articles