Statalist


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

Re: st: by year: xtile


From   Kaspar Dardas <kaspar.dardas@googlemail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: by year: xtile
Date   Tue, 10 Nov 2009 11:31:31 +0100

Thank you Ulrich! This works perfect.

2009/11/10 Ulrich Kohler <kohler@wzb.eu>:
> 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/
>

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index