LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (July 1998, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 14 Jul 1998 19:38:24 GMT
Reply-To:     Andreas Grueninger <grueni@STUTTGART.NETSURF.DE>
Sender:       "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From:         Andreas Grueninger <grueni@STUTTGART.NETSURF.DE>
Organization: LF.net GmbH, Internet Services, Stuttgart, Germany
Subject:      Re: Time Variable

On Tue, 14 Jul 1998 09:22:11 -0700, Jason Barbour <jbarbour@gladstone.ucsf.edu> wrote:

>I have a data set with multiple observations per individual. >Example > >id date rbc wbc >1 2/96 4 5 >1 4/96 3 6 >1 6/96 7 12 >1 8/96 9 10 >1 9/96 8 11 > >I would like to: > >Create a variable 'time' that runs from 1 to 5 (in this case) >or up the number of the last visit.

I am not sure if I got the real problem. But you can build this variable time very simple. If the data is not sorted : PROC SORT DATA=...; BY id date; RUN;

DATA ...; SET ...; BY id date; IF (FIRST.id) THEN time = 0; time + 1; RUN; --------------------------- Andreas Grueninger

PRIVAT: grueni@stuttgart.netsurf.de OFFICIAL: grueninger@lfl.bwl.de ---------------------------


Back to: Top of message | Previous page | Main SAS-L page