Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Grouped vars with different summary measures in one table


From   "Austin Nichols" <austinnichols@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Grouped vars with different summary measures in one table
Date   Mon, 17 Dec 2007 09:20:50 -0500

Gawrich Stefan <s.gawrich@hlpug.hessen.de>:
You might find -tabstatmat- helpful; some users like a marriage of
-tabstatmat- and -xlm_tab- very useful.  Both are available from SSC
and easily acessible via -findit-.  The -collapse- option is a good
one, with the -fast- option, especially after first -preserve-ing your
data, possibly with a -tabdisp- at the end. But my personal favorite
is to calculate results one by one in a -foreach- loop, and use -file-
to write results to a file as I go; see e.g.
http://www.stata.com/statalist/archive/2006-04/msg01090.html
http://www.stata.com/statalist/archive/2006-09/msg00837.html
http://www.stata.com/statalist/archive/2007-10/msg00903.html

On Dec 17, 2007 4:44 AM, Gawrich Stefan <s.gawrich@hlpug.hessen.de> wrote:
> I often have to report different summary measures of different vars by
> group-level in one table. For example I'd like to display the proportion of
> overweight pre-school children (mean of dummy-var var1), the number of cases
> (sum of counting-var var2) and the median score of a test (p50 of var3) by
> city:
>
> tabstat (one-by-one or with all vars and summary measures specified
> simultaniously) give the results but one needs a lot of copy & paste to a
> spreadsheet to get it in shape. collapse is of course another solution but
> slow with big datasets and certainly a very big transformation just to
> obtain some descriptive statistics.
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2021 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index