. egen rank =rank(score) ,field
Raphael wrote
I would like to create the variable rank based on the
variable score as given below. This has proved more
difficult than previously thought. Can any one help?
id score rank
1. 8 90 1
2. 7 40 2
3. 6 20 3
4. 5 20 3
5. 4 20 3
6. 3 8 6
7. 2 6 7
8. 1 6 7
Kit Baum, Boston College Economics
http://ideas.repec.org/e/pba1.html
*
* 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/