Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: percentage format


From   Caleb Southworth <[email protected]>
To   [email protected]
Subject   Re: st: percentage format
Date   Wed, 9 Feb 2011 09:02:56 -0800 (PST)

The mean of a 0-1 variable is its proportion or x100 is the 
percentage, so

gen per=surgery*100

table sex agegroup, c(mean surgery)

HTH, Caleb

On Wed, 9 Feb 2011, Harry Comber wrote:

:Is there an extension of the Stata -format- command which produces
:percentage formats? I would like to use this in the -table- command as
:in (hypothetically):
:	table sex agegroup, c(sum surgery) format(%2.1p)
:If "surgery" is either 0 (no) or 1 (yes) for each individual, this would
:give a table of % having surgery. I know there are other ways of doing
:this but the tables are typically much more complex than the example
:given and it would be very useful to me if I could format the output as
:percentages.
:
:Harry Comber
:
:------------------------------------------------------------------------
:-- 
:Dr. Harry Comber, Director
:National Cancer Registry (www.ncri.ie)
:Building 6800
:Cork Airport Business Park
:Kinsale Road
:Cork.
:Tel  +353 21 4318014
:Fax +353 21 4318016
:Email: [email protected]
:------------------------------------------------------------------------
:------- 
:The contents of this email are intended for the named addressee only. It
:contains information that may be confidential. Unless you are the named
:addressee or an authorised designee, you may not copy or use it, or
:disclose it to anyone else. If you have received it in error please
:notify us immediately and then destroy it. The NCRI does not guarantee
:the security of any information electronically transmitted and is not
:liable if the information contained in this communication is not a
:proper and complete record of the message as transmitted by the sender
:or for any delay in its receipt.
: 
:
:
:*
:*   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/
:

Caleb Southworth
Associate Professor
Univ. of Oregon Sociology
*
*   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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index