nine.angelina@GMAIL.COM wrote back:
>Sorry, Maybe I didn't express my quenstion clearly.
>I don't really want to show the time order.
>I just want to know which combination of the time order the observation
>belongs to.Becuase the three numbers of the first observation is
>20050101<20050123<20050126, that means time1 is earlier than time2 and
>time2 is earlier than time3, the combination is 1 in the Number variable.
>And those of the second observation is 20050707<20050808<20060606, that
>means time1 is earlier than time3 and time3 is earlier than time2, the
>combination is 2 in the Number variable. I think a direct method. I don't
>know whether it works because I haven't reinstalled SAS in my computer in
Here's a really simple way to do it and get six unique levels. You can
Boolean components to get the numbering in any order you want:
compare = 1 + (temp1>temp2) + (temp1>temp3) + 3*(temp2>temp3);
Of course, this approach is not extensible.
So.. why do you want this kind of comparison?
David L. Cassell
3115 NW Norwood Pl.
Corvallis OR 97330
On the road to retirement? Check out MSN Life Events for advice on how to
get there! http://lifeevents.msn.com/category.aspx?cid=Retirement