Date: Wed, 12 Nov 2003 13:57:45 +0100
Reply-To: la volta statistics <schmidhauser@lavolta.ch>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: la volta statistics <schmidhauser@lavolta.ch>
Subject: AW: Combining variables across cases: school projects
In-Reply-To: <CD39AFB03505D611B26400B0D0F9CDF09555BC@cem025.dur.ac.uk>
Content-Type: text/plain; charset="iso-8859-1"
David,
This should work.
Christian
DATA LIST LIST /school(A8), id(F8.0), proj_1(F8.0), proj_2(F8.0).
BEGIN DATA
A 27924 0 1
B 40198 1 0
B 40198 0 1
C 31551 1 0
D 27927 1 0
D 27927 0 1
END DATA.
Aggregate Outfile = *
/Break = School ID
/proj_1 = MAX(proj_1)
/proj_2 = MAX(proj_2).
List.
-----Ursprüngliche Nachricht-----
Von: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU]Im Auftrag von
David Hutton
Gesendet: Mittwoch, 12. November 2003 12:47
An: SPSSX-L@LISTSERV.UGA.EDU
Betreff: Combining variables across cases: school projects
Dear Listers:
I have a set of schools, all involved in either one or both of two projects.
Each school has either one or two records in my dataset.
I wish to list each school only once but still record which projects they
are in.
Hence schools B and D need records combining; A and C need leaving as they
are.
Any syntax ideas, please?
DATA LIST LIST /school(A8), id(F8.0), proj_1(F8.0), proj_2(F8.0).
BEGIN DATA
A 27924 0 1
B 40198 1 0
B 40198 0 1
C 31551 1 0
D 27927 1 0
D 27927 0 1
END DATA.
EXPECTED OUTPUT
school ID proj_1 proj_2
A 27924 0 1
B 40198 1 1
C 31551 1 0
D 27927 1 1
All the best,
David Hutton
_______________________________________________
C.E.M. Centre, University of Durham
Mountjoy Research Centre 4
Stockton Road, DURHAM DH1 3UZ
<http://www.cem.dur.ac.uk/> CEM Centre Website