Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: generating variable that reflects order of values of another variable
From
"Rubil Ivica" <[email protected]>
To
<[email protected]>
Subject
st: generating variable that reflects order of values of another variable
Date
Wed, 16 Jan 2013 15:28:21 +0100
Dear all,
Suppose I have N observations on a variable var1. How to generate
another variable var2 which takes on values 1 to N, where 1 is assigned
to the observation with the lowest value of var1, N is assigned to the
observation with the highest value of var1, and all other values between
1 and N are assigned accordingly?
Thanks.
--
Ivica Rubil
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/