Statalist


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

st: stsplit according to percentiles of a variable


From   Serguei Kaniovski <[email protected]>
To   [email protected]
Subject   st: stsplit according to percentiles of a variable
Date   Wed, 20 Feb 2008 11:01:54 +0100

Hello All,

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')

How can I make it work?

Thanks in advance,
Serguei Kaniovski

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