Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: by year: xtile


From   Ulrich Kohler <[email protected]>
To   [email protected]
Subject   Re: st: by year: xtile
Date   Tue, 10 Nov 2009 11:20:44 +0100

There is a egen function in -egenmore- for this:

. ssc install egenmore
. egen mcadecile = xtile(mcap), by(years) p(10(10)90)


Am Dienstag, den 10.11.2009, 10:43 +0100 schrieb Kaspar Dardas:
> Hello,
> 
> 
> I have two variables years (2005 2006 2007...) and mcap (which is the
> capitalization of firms, numeric values). I would like to create
> deciles of mcap by years (not across the entire sample but for each
> year) . Is there a quick way to do this besides a loop for the below?
> 
> xtile mcapdecile = mcap, nq(10)
> 
> Many thanks,
> 
> Kaspar
> 
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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