Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

st: Problem with xtile-command from the egenmore package


From   "Jürgen Haas" <haasjuergen@gmx.net>
To   statalist@hsphsun2.harvard.edu
Subject   st: Problem with xtile-command from the egenmore package
Date   Mon, 11 Feb 2013 23:41:28 +0100

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/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index