Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: RE: rank error?


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   RE: st: RE: rank error?
Date   Wed, 28 May 2003 13:37:59 +0100

Jeph Herrin

> Nick Cox wrote:
> 
> >>
> >>If one wants to do a certain operation on all obs with -var1-==X,
> >>indexing through all the values of X, and do so in order of 
> >>increasing
> >>X, then the value of such a ranking becomes obvious.
> >>
> > 
> > 
> > Now we have convergence. Try -egen, group()-. 
> > 
> 
> Not clear to me that -group(X)- assigns values in
> order of increasing  X (even if, as E Berkhout suggests
> in a separate posting, I sort -sort X- first).
> 
> 
> 
> > BTW: have a look also at -levels-. 
> > 
> 
> Same problem. Not clear that -levels- returns a list that
> is sorted in increasing order. Plus, in my particular
> case I have non-integers (though that's easily gotten
> around).

Both work for me. 

A look at the code for each shows that both 
produce sorted values and that's the intent 
in each case.  

-levels- is not appropriate directly for 
problems in which categories are defined by 
numbers with fractional parts. Otherwise 
I can't comment further on what is not clear 
to you without knowing what your doubts are. 

Nick 
[email protected] 

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index