I have a variable "birthyear" (which is in a date format; eg. dd/mm/yyyy) in SAS with data from Jan 1st 1982-December 31st 2010.
I want to create a new categorical variable (time) which would divide the years of data into three groups, so that I can stratify by this variable in my analysis. I want the new categorical variable to be defined as follows:
Time =1 if birthyear >=1982 and <1991
Time =2 if birthyear >=1992 and <2001
Time =3 if birthyear >=2002 and <= 2010.
Does anyone have the code please?
Thanking you
Sinead
You may leave the list at any time by sending the command
SIGNOFF allstat
to [log in to unmask], leaving the subject line blank.
|