Date: Wed, 24 Oct 2001 20:54:57 -0400
Reply-To: Raynald Levesque <rlevesque@VIDEOTRON.CA>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Raynald Levesque <rlevesque@VIDEOTRON.CA>
Subject: Re: Calculating mean age from month, day, and year
In-Reply-To: <003101c15ccc$424e5c40$dc2bfc40@hppav>
Content-Type: text/plain; charset="iso-8859-1"
Hi Rich
This is a Very FAQ...
DATA LIST LIST /mth1 day1 year1.
BEGIN DATA
1 1 1950
1 1 1960
7 1 1960
10 1 1960
1 23 2000
END DATA.
LIST.
COMPUTE date1=DATE.DMY(day1,mth1,year1).
COMPUTE age=CTIME.DAYS(DATE.DMY(1,1,2001)-date1)/365.25.
FORMATS date1(ADATE11).
VARIABLE WIDTH date1(10).
SUMMARIZE
/TABLES=age
/FORMAT=NOLIST TOTAL
/TITLE='Mean age'
/MISSING=VARIABLE
/CELLS=MEAN .
If you need the average value to be in the data editor, use Aggregate than
merge the result with the initial file.
Raynald Levesque rlevesque@videotron.ca
Visit my SPSS Pages http://pages.infinit.net/rlevesqu/index.htm
-----Original Message-----
From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU]On Behalf Of Rich
DioGuardi
Sent: Wednesday, October 24, 2001 4:41 PM
To: SPSSX-L@LISTSERV.UGA.EDU
Subject: Calculating mean age from month, day, and year
Hi,
I have SPSS version 8.0 and I was wondering if anyone could help me with
calculating the mean age of a sample of participants from data that is set
up in three separate columns (variables): month, day, and year.
Thanks :)
-Richard
|