# AW: st: Summary Stat Table

 From "Martin Weiss" To Subject AW: st: Summary Stat Table Date Wed, 11 Nov 2009 14:50:23 +0100

```<>

" Though it surprises me as to why tabstat is not 'byable' at two levels"

In defence of -tabstat-:

*************
by rep78 foreign, sort: tabstat price mpg headroom, statistics( mean count )
columns(statistics)
*************

HTH
Martin

-----Ursprüngliche Nachricht-----
Von: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Prabal De
Gesendet: Mittwoch, 11. November 2009 14:49
An: statalist@hsphsun2.harvard.edu
Betreff: Re: st: Summary Stat Table

Dear Martin and Roy,
Thanks a lot. Apologies for  the messed up format. I should have
verbally explained. I never thought of using outreg in this way.
Though it surprises me as to why tabstat is not 'byable' at two levels
while something like -collapse- is.
Regards,
Prabal

>
> sysuse auto, clear
> gen white=cond(uniform()>.5,1,0)
> gen black=cond(white==1,0,1)
> gen male=cond(uniform()>.5,1,0)
> gen female=cond(male==1,0,1)
>
> outreg2 using myfile if white==1 & male==1, sum(log) eqkeep(mean N) /*
> */ cttop(white, male) drop(white male female) excel replace
>
> outreg2 using myfile if white==1 & female==1, sum(log) /*
> */ eqkeep(mean N) cttop( , female) drop(white male female) excel
>
> outreg2 using myfile if white==1, sum(log) eqkeep(mean N) /*
> */ cttop( , total) drop(white male female) excel
>
> outreg2 using myfile if black==1 & male==1, sum(log) eqkeep(mean N) /*
> */ cttop(black, male) drop(white male female) excel
>
> outreg2 using myfile if black==1 & female==1, sum(log) /*
> */ eqkeep(mean N) cttop( , female) drop(white male female) excel
>
> outreg2 using myfile if black==1, sum(log) eqkeep(mean N) /*
> */ cttop( , total) drop(white male female) excel
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```