Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Ranking timed data


From   Sascha Robert <[email protected]>
To   STATA List <[email protected]>
Subject   st: Ranking timed data
Date   Thu, 14 Apr 2005 11:30:54 +0200

Hi

I applogize for this newbie question in advance.
My data looking like this

time id var
1 1 19.5
1 2 20.7
1 3 15.0
2 1 16.5
2 2 21.7
2 3 17.0
...

Now I would like to generate a variable 'rank' for each value of 'time' representing the ordinal number of th value 'var':

time id var rank
1 1 19.5 2
1 2 20.7 1
1 3 15.0 3
2 1 16.5 3
2 2 21.7 1
2 3 17.0 2
...

. recode does not seem to work, because 'var' changes to a great extent over time.

Any hints? Thankyou
Sascha

--
***** sascha robert | mailto: [email protected] *****
*
* 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/




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