Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: Table display


From   Fred Wolfe <[email protected]>
To   [email protected]
Subject   RE: st: Table display
Date   Fri, 15 Apr 2005 15:48:53 -0500

At 03:40 PM 4/15/2005, you wrote:
Fred,

Exactly what I was looking for.  Thank you.  Is there a way to turn the
min/max options on and off?

Yes, if you are only including categorical variables, this will do:

. fsum sex,catvar(sex) s(mean)

Variable | N Mean
--------------+------------------
Sex (% male) | 89597 20.89
Female (%) | 70881 79.11
Male (%) | 18716 20.89

I have an updated version that I will post to the BC archives soon. It corrects a "bug" (Stata limitation) that probably no one has experienced yet excet me.

Fred



Carter

*******************************************
Carter Rees, M.A.
Associate Research Scientist
Wyoming Survey & Analysis Center
University of Wyoming
710 Garfield St.
Suite 320
Laramie, WY 82072
307-399-0496
*******************************************

-----Original Message-----
From: Fred Wolfe [mailto:[email protected]]
Sent: Friday, April 15, 2005 2:34 PM
To: [email protected]
Subject: RE: st: Table display

The fsum program available (ssc install fsum) does something like this.
The
values happen to be 0 and 1, but will work with any level of category

. fsum age sex

      Variable
|        N     Mean       SD      Min      Max

--------------+---------------------------------------------
   Age (years) |    89597    62.59    12.82    16.55   103.27
  Sex (% male) |    89597    20.89

. tabl sex

sex (Patient's gender)     code  |   Freq    Percent
---------------------------------+--------------------
                 Female       0   |  70881      79.11
                   Male       1   |  18716      20.89
---------------------------------+--------------------
                          Total   |  89597     100.00

. fsum age sex,catvar(sex)

      Variable
|        N     Mean       SD      Min      Max

--------------+---------------------------------------------
   Age (years) |    89597    62.59    12.82    16.55   103.27
  Sex (% male) |    89597    20.89
   Female (%)  |    70881    79.11
     Male (%)  |    18716    20.89





At 03:26 PM 4/15/2005, you wrote:
>Clint,
>
>Close.  All of the variables are dummies so I would like to get a
>summary table that includes the counts for each 0 and 1.  Still
>digging....
>
>Thanks.
>
>Carter
>
>-----Original Message-----
>From: [email protected]
>[mailto:[email protected]]
>Sent: Friday, April 15, 2005 2:22 PM
>To: [email protected]
>Subject: Re: st: Table display
>
>-tabstat- may get you what you want...for example,
>
>tabstat disproc contacts osex vsex violrc relrc weaprc injrc, stat(mean
>sd min max n)
>col(stat)
>
>type -findit tabstat- in the command window for more information.
>
>hope this helps, clint
>
>On 15 Apr 2005 at 14:10, Carter Ivan Rees wrote:
>
> > Is there any way to make the following summarize table display the
> > number of observations next to my min max values?
> >
> > summarize disporc contacts osex vsex violrc relrc weaprc injrc,
> > separator(2)
> >
> >     Variable |       Obs        Mean    Std. Dev.       Min
Max
> >
-------------+--------------------------------------------------------
> >      disporc |     12511    .5542323      .49707          0
1
> >     contacts |     12511    .0877628    .2829609          0
1
> >
-------------+--------------------------------------------------------
> >         osex |     12511    .7273599    .4453351          0
1
> >         vsex |     12511    .3035729    .4598187          0
1
> >
-------------+--------------------------------------------------------
> >       violrc |     12511    .9744225    .1578774          0
1
> >        relrc |     12511     .697706    .4592703          0
1
> >
-------------+--------------------------------------------------------
> >       weaprc |     12511    .0683399    .2523383          0
1
> >        injrc |     12511    .4987611    .5000184          0
1
> >
> >
> > Thanks to all.
> >
> > Carter
> >
> >
> > *
> > *   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/
>
>
>
>
>Clinton J. Thompson
>Econometrica, Inc.
>4416 East-West Highway, Suite 215
>Bethesda, MD  20814
>Phone: 240-333-4803
>Fax: 301-657-3140
>www.EconometricaInc.com
>
>The information transmitted is intended only for the person
>or entity to which it is addressed and may contain confidential
>and/or privileged material. Any review, re-transmission,
>dissemination or other use of, or taking of any action
>in reliance upon, this information by persons or entities
>other than the intended recipient is prohibited. If you
>received this in error, please contact the sender and
>delete the material from any computer.
>
>*
>*   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/
>
>
>
>*
>*   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/


Fred Wolfe
National Data Bank for Rheumatic Diseases
Wichita, Kansas
Tel (316) 263-2125     Fax (316) 263-0761
[email protected]


*
*   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/


*
*   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/

Fred Wolfe
National Data Bank for Rheumatic Diseases
Wichita, Kansas
Tel (316) 263-2125     Fax (316) 263-0761
[email protected]


*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index