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

Re: st: programming help


From   "philippe van kerm" <philippe.vankerm@ceps.lu>
To   <statalist@hsphsun2.harvard.edu>
Subject   Re: st: programming help
Date   Tue, 22 Feb 2005 15:39:57 +0100

The -clsort- EGEN function (findit _gclsort) might be your friend here,
if, as Scott suggests, you have the data stored as variables. You could
go 

gsort - Y
egen Xnew = clsort(X)
replace Xnew = Y if Y>Xnew


You need to check but that should be near what you want if I understand
correctly.


Hope this helps,

Philippe




<<<>>><<<>>><<<>>><<<>>><<<>>><<<>>><<<>>><<<>>>
Dr. Philippe Van Kerm
IRISS - Integrated Research Infrastructure in 
  the Socio-Economic Sciences
CEPS/INSTEAD
BP48, L-4501 Differdange, Luxembourg
>> http://www.ceps.lu/iriss <<
>> http://econpapers.hhs.se/RAS/pva19.htm <<
<<<>>><<<>>><<<>>><<<>>><<<>>><<<>>><<<>>><<<>>> 

**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept 
**********************************************************************



*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index