In addition to other answers, check out Ulrich Kohler's
-egen- function within -egenmore- on SSC. 
Nick 
[email protected] 
Erasmo Giambona
> 
> I need to create deciles for my dataset by year. I understand STATA
> allows one to get deciles for the full data set (in my case I used:
> xtile size_decile=size1, nq(10)), but I  really need to get my deciles
> by year. I realize that the "by" group does not work with "xtile". Is
> there any way to get the size deciles by year?
*
*   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/