Statalist


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

st: RE: stsplit according to percentiles of a variable


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: stsplit according to percentiles of a variable
Date   Wed, 20 Feb 2008 12:54:39 -0000

Use -summarize _t, detail- and pass its results as e.g. `r(min)' 

Serguei Kaniovski

After "stset" I have the time-elapsed variable "_t". I would like to
"stsplit" data according to the percentiles of "_t", but dont know how
to
put the percentile value in the numlist. Something which does not work
(but
hopefully shows what I am aiming at) is

egen pmin=min(_t)
egen p25=pctile(_t), p(25)
egen pmax=max(_t)

stsplit age, at(`pmin'(1)`p25' `p25'(5)`pmax')


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