Date: Wed, 8 Dec 2004 19:48:24 -0500
Reply-To: Raynald Levesque <rlevesque@videotron.ca>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Raynald Levesque <rlevesque@videotron.ca>
Subject: Re: average
In-Reply-To: <EF7BBA2DD53A424D9D9C704717709EAEE4ACCA@asvr1.starr.org>
Content-type: text/plain; charset=iso-8859-1
Hi
The solution suggested by Christopher works but is not efficent (with large
data files) because it has many unnecessary EXECUTE commands.
The following is an alternative (the quarterly figures end up in the data
file ans are immediately useable):
Data List Free / Date (MOYR8) Number.
Begin Data
01-1990 2000
02-1990 2100
03-1990 1999
10-2004 3700
11-2004 3300
12-2004 3500
End Data.
COMPUTE Qrt=XDATE.QUARTER(date).
COMPUTE Yr=XDATE.YEAR(date).
COMPUTE YearQtr=Yr*10 + Qrt.
AGGREGATE OUTFILE=*
/BREAK=YearQtr
/meannb=MEAN(number).
Regards
Raynald Levesque Raynald@spsstools.net
Visit my SPSS site: http://www.spsstools.net
-----Original Message-----
From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU]On Behalf Of
Traynor, Christopher
Sent: December 8, 2004 1:32 PM
To: SPSSX-L@LISTSERV.UGA.EDU
Subject: Re: average
Hello,
Copy this syntax and run. Is this what you want?
Data List Free / Date (MOYR8) Number.
Begin Data
01-1990 2000
02-1990 2100
03-1990 1999
10-2004 3700
11-2004 3300
12-2004 3500
End Data.
COMPUTE Qtr = XDATE.QUARTER(Date) .
EXECUTE .
FORMAT Qtr (F5.0).
STRING V1 (A5).
exe.
COMPUTE V1=STRING(Qtr,F1.0).
exe.
COMPUTE YR=XDATE.YEAR(DATE).
exe.
FORMAT Yr (F2.0).
STRING V2 (A4).
exe.
COMPUTE V2=STRING(YR,F4.0).
exe.
STRING QtrYear (A10).
COMPUTE QtrYear=CONCAT(V1,V2).
EXECUTE.
SORT CASES BY QtrYear .
SPLIT FILE
LAYERED BY QtrYear .
DESCRIPTIVES
VARIABLES=Number
/STATISTICS=MEAN STDDEV MIN MAX .
-----Original Message-----
From: Bertin Dadaille [mailto:Dadaille.Bertin@tbs-sct.gc.ca]
Sent: Wednesday, December 08, 2004 10:15 AM
To: SPSSX-L@LISTSERV.UGA.EDU
Subject: average [faked-from][heur]
Dear All,
I have a series of data on a monthly basis. From 1990 to 2004
01-1990 2000
02-1990 2100
03-1990 1999
..
.
.
.
12-2004 3500
I would like that SPSS convert those data on a quarterly basis. Which mean
to take always the average of 3 months.
Can someone help me.
Bertin Dadaille
Research Officer | Agent de recherche
Compensation Planning Division | Division de la planification de la
rémunération
Human Resources Management Office | Bureau de la gestion des ressources
humaines
Treasury Board of Canada, Secretariat | Secrétariat du Conseil du Trésor du
Canada
Ottawa, Canada K1A 0R5
613-957-8290 | Dadaille.Bertin@tbs-sct.gc.ca | facsimile/télécopieur
613-957-0425
-----Original Message-----
From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU]On Behalf Of
Spousta Jan
Sent: December 8, 2004 6:33 AM
To: SPSSX-L@LISTSERV.UGA.EDU
Subject: Re: SPSS Syntax Question
Hi Kevin,
"Value labels" destroys all the previous labels, "add var lab" leaves them
unchanged unless explicitly mentioned.
Greetings
Jan
-----Original Message-----
From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU]On Behalf Of Zhou
Kang
Sent: Wednesday, December 08, 2004 12:11 PM
To: SPSSX-L@LISTSERV.UGA.EDU
Subject: SPSS Syntax Question
Dear All,
What's main difference between 'Value Labels' and 'Add Value Labels' in SPSS
Syntax?
Thanks in advance.
Kevin