This problem arises a lot, and has been discussed frequently on the list, but -egen- is not the right keyword to search on.
Search the archives using -rowsort- and -sortrows- as key words.
Or doing it in Mata by using -egen, rowmedian()- from -egenmore- on SSC as a starting-point.
Also, if you want this, you might consider -reshape-, -generate- and -reshape- as a sequence.
Nick
[email protected]
Augusto Cadenas
I wanted to go beyond the command -egen rowmin(/varlist/)- and create
a new variable containing the second-smallest value in /varlist/,
another one with the third-smallest and so one. Could anyone suggest
me a way to do this? I searched among the extensions of egen, but I
could not find anything suitable.
*
* 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/