Statalist The Stata Listserver

[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: -egen rank ()

From   Jeph Herrin <>
Subject   Re: st: -egen rank ()
Date   Thu, 21 Sep 2006 10:08:17 -0400

Did you try the /track/ option?

Nikolaos A. Patsopoulos wrote:

I want to create a variable containing the rank order of another one but I cannot make tie corrections:

the data:

v6 countMain aaa 374
bbb 213 ccc 204 gvfdg 193
gfdg 170
gfdh 166

I use egen rankMain=rank( countMain) if counter_v6==1, field #counter_v6 is a _n variable for v6

if I don't use the /field/ parameter I get the reverse order of that I want, e.g. aaa gets a rank of 4880 instead of 1. However using field doesn't correct for ties (want to use the average for ties).

Any suggestions?

Thanks in advance,


* For searches and help try:

*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index