Date: Tue, 6 Oct 1998 14:39:56 -0500
Reply-To: "Lucas, Gail" <glucas@SPSS.COM>
Sender: "SPSSX(r) Discussion" <SPSSX-L@UGA.CC.UGA.EDU>
From: "Lucas, Gail" <glucas@SPSS.COM>
Subject: Re: How to calculate age
First, you need to change your numeric variable into a date variable. Here
is some sample syntax that should work.
Replace DATE2 with the name you want the new date variable to be, replace
"numericvar" with the name of the variable that has the date in a numeric
STRING BDATE (A4).
STRING MO (A2).
STRING YR (A2).
COMPUTE DATE2=number(concat(MO,"/", YR),MOYR).
FORMATS DATE2 (MOYR).
Then, in order to compute the age (I'm assuming you want the age based on
the day their data was collected):
DATE2 would be the variable for the date the data was collected, and
birthdate would be the day they were born.
If you wanted their age based on today, you would need to first:
Which would create a variable, TODAY that is today's date. Then, substitute
TODAY for DATE2.
If you have any questions, feel free to email me.
SPSS Technical Support
From: Martin F. Sherman [mailto:MFS@VAX.LOYOLA.EDU]
Sent: Tuesday, October 06, 1998 1:44 PM
Subject: How to calculate age
I have dates presented in two different ways. One date came in as numeric
1148 which stands for November, 1948.
How would I convert this to a date format. The other date came in as date
data - 11/01/48.
One date represents the day the data was collected while the other date is
the birthdate of participant. I want to calculate their age and just can't
remember how to do it.
Thanks for any assistance