[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: -egen rank ()
Hi,
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,
Nikos
*
*   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/