Statalist The Stata Listserver


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

RE: st: working with percentile cutpoints


From   "Visintainer, Paul" <PAUL_VISINTAINER@NYMC.EDU>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: working with percentile cutpoints
Date   Tue, 22 May 2007 13:49:59 -0400

Thanks, Svend.  That's what I needed.  (Thanks also Brent for the
work-around)

-p



--------------------------------------------------------------------
 
The -egenmore- -xtile()- function does it. You may need first to
    ssc install egenmore
 
. sysuse auto , clear
. egen pricegrp = xtile(price) , percentiles(13 35 73)
. tab1 pricegrp
 
-> tabulation of pricegrp  
 
   pricegrp |      Freq.     Percent        Cum.
------------+-----------------------------------
          1 |         10       13.51       13.51
          2 |         16       21.62       35.14
          3 |         29       39.19       74.32
          4 |         19       25.68      100.00
------------+-----------------------------------
      Total |         74      100.00

Hope this helps
Svend
________________________________________________________ 
 
Svend Juul
Institut for Folkesundhed, Afdeling for Epidemiologi
(Institute of Public Health, Department of Epidemiology)
Vennelyst Boulevard 6 
DK-8000 Aarhus C,  Denmark 
Phone, work:  +45 8942 6090 
Phone, home:  +45 8693 7796 
Fax:          +45 8613 1580 
E-mail:       sj@soci.au.dk 
_________________________________________________________ 

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



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