Date: Tue, 20 Apr 1999 10:05:18 -0400
Reply-To: mitchell@earinc.net
Sender: "SPSSX(r) Discussion" <SPSSX-L@UGA.CC.UGA.EDU>
From: John Mitchell <mitchell@EARINC.NET>
Subject: Re: computing age
In-Reply-To: <3.0.6.32.19990420133453.010c1d80@unix1.derby.ac.uk>
Content-Type: text/plain; charset="iso-8859-1"
Sorry to barge in on this conversation. Jeremy - do you (or does anyone else
out there) know a way to use the system date in syntax so that the
calculation of age can be automated and repeated on any given day without
rewriting code?
Thanks.
John Mitchell
-----Original Message-----
From: SPSSX(r) Discussion [mailto:SPSSX-L@UGA.CC.UGA.EDU]On Behalf Of
Jeremy Miles
Sent: Tuesday, April 20, 1999 8:35 AM
To: SPSSX-L@UGA.CC.UGA.EDU
Subject: Re: computing age
At 07:35 20/04/99 -0500, Sue O'Donnell wrote:
> Any ideas? Thanks! Susan L. O'Donnell
>
To calculate someone's age, we subtract their birth data from the current
date. We have to give the current date to SPSS using the date.dmy function.
Use compute to calculate age as being equal to d.o.b - date.dmy(23, 2, 99)
[or whatever is today's date].
However, this will give age in seconds (because of the way that SPSS stores
time. To calculate age, we must calculate age_in_years = age-in_seconds /
(60 * 60 * 24 * 365.25).
=====================================================================
Jeremy Miles j.n.v.miles@derby.ac.uk
Phone: 01332 622222 x3138 Fax: 01332 622287 Mobile: 07971 218172
Inst. of Behavioural Sciences, Derby University, Derby, DE22 3HL,UK
================ http://ibs.derby.ac.uk/~jeremym ====================