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/