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 at the end of May, and its replacement, statalist.org is already up and running.


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

st: RE: panel data, sorting in deciles


From   Nick Cox <n.j.cox@durham.ac.uk>
To   "'statalist@hsphsun2.harvard.edu'" <statalist@hsphsun2.harvard.edu>
Subject   st: RE: panel data, sorting in deciles
Date   Mon, 11 Oct 2010 10:44:11 +0100

The implication is that you already have a variable called -deciles-. -xtile- expects to be given a new variable name. See the help for -deciles- again. 

Nick 
n.j.cox@durham.ac.uk 

Biljana Dlab

I have panel data (sorted firmID and financial year).

For my regression I need to select firm-years, according to asset size,
that is in top three and bottom three deciles.

For this purpose I followed your instructions (Decile sorts,
http://www.stata.com/statalist/archive/2006-11/msg00309.html) and
applied the following solution:

. foreach X of varlist dat* {
  2. xtile deciles=`X', n(10)
  3. }
deciles already defined

why did I get "deciles already defined" message in red.

And is that correct code or should I modify it?


*
*   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   |   Site index