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

Re: st: quintiles


From   "Jens M. Lauritsen" <[email protected]>
To   [email protected]
Subject   Re: st: quintiles
Date   Fri, 28 Feb 2003 20:19:18 +0100

For quintiles use the cut subcommand for egen, e.g.:
. version
version 7.0
. use bromar
(Marathon data - 1995 across bridges from Funen and West-Jutland)
. egen q5 = cut(age), group(5) label
(241 missing values generated)
. tab q5

         q5 |      Freq.     Percent        Cum.
------------+-----------------------------------
        16- |        735       19.41       19.41
        32- |        725       19.15       38.56
        38- |        788       20.81       59.38
        44- |        688       18.17       77.55
        49- |        850       22.45      100.00
------------+-----------------------------------
      Total |       3786      100.00

or for complete labeling of both ends of intervals get the extended cut
(findit cutjl) :

. egen q5i = cutjl(age), group(5) interval
(241 missing values generated)

. tab q5i

        Age |
 (1996-year |
  of birth) |      Freq.     Percent        Cum.
------------+-----------------------------------
      16-31 |        735       19.41       19.41
      32-37 |        725       19.15       38.56
      38-43 |        788       20.81       59.38
      44-48 |        688       18.17       77.55
      49-84 |        850       22.45      100.00
------------+-----------------------------------
      Total |       3786      100.00


Jens M. Lauritsen, Consultant,MD. PhD.
Accident Analysis Group, Odense University Hospital, 
Odense, Denmark e-mail: [email protected]
Initiator of EpiData, see www.epidata.dk for DataEntry in windows (EpiInfo
V6 principle)
For news on Epidata, sign on at: www.epidata.dk/php/maillist.php
Phone +45 6541 2293 Mobile +45 2173 2293 fax: +45 6613 6581 
*
*   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