Hi,
I analyze a panel dataset that includes the daily market capitalizations of a group of firms. Now, I want to group these firms into deciles based on their market capitalizations on a monthly basis.
To do so, I use the xtile-command from the egenmore-package. This is my command:
en month=mofd(date)
egen decile_id = xtile(marketcap), nquantiles(10) by(month)
For all days of a certain month, a firm should stay in one decile group. However this is not the case. Often, a firm's group changes over the course of a month.
My first thought was that my command was flawed and calculated deciles on a daily basis. However, using
egen decile_id = xtile(marketcap), nquantiles(10) by(date)
delivers a different result and the computation does also take somewhat more time.
Thanks in advance,
Jürgen Haas
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/