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

RE: st: sort


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   RE: st: sort
Date   Wed, 29 Jun 2005 17:48:08 +0100

Quite so. Thanks, 

Nick 
[email protected] 

Richard Williams
 
> At 09:54 AM 6/29/2005 +0100, Nick Cox wrote:
> >The essence of Florence's problem is that two (or more) variables
> >be sorted together. How would this -egen- function be used
> >to achieve that?
> 
> Looks like you make repeated calls to the function, e.g.
> 
> . webuse auto
> (1978 Automobile Data)
> 
> . egen xprice = clsort(price)
> 
> . egen xmpg = clsort(mpg)
> 
> . list price xprice mpg xmpg in 1/5
> 
>       +-----------------------------+
>       | price   xprice   mpg   xmpg |
>       |-----------------------------|
>    1. | 4,099     3291    22     12 |
>    2. | 4,749     3299    17     12 |
>    3. | 3,799     3667    22     14 |
>    4. | 4,816     3748    20     14 |
>    5. | 7,827     3798    15     14 |
>       +-----------------------------+

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