Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[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" <[email protected]>
To   [email protected]
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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index