Date: Tue, 16 Sep 2003 12:59:43 +0200
Reply-To: "Schmid, Hans-Peter" <Hans-Peter.Schmid@dlr.de>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: "Schmid, Hans-Peter" <Hans-Peter.Schmid@dlr.de>
Subject: Do repeat, do if end if, recode > 2x 288 variables
Content-Type: text/plain; charset="ISO-8859-1"
Dear List,
i have the following dataset (time-use data):
288 variables zha1 to zha288 which symolise 5minute - units (288x5= 24hours=
1 day).
In each 5minute unit, there is a value for a acvivity (1002 means work for
example, 1007 is freetime).
and
288 variables zwo1 to zwo288 which have the values 1=at home and 2=not at
home (for the activities mentioned above).
My problem is the following:
zha1 zha2 zha3 ... zwo1 zwo2 zwo3 ... ...
zwo288
1002 1007 1002 ... 1 1 2 ... ...
I want to RECODE zwo1 to zwo288 so that i have the following values:
zwo1 zwo2 zwo3 ...
zwo288
work at home freetime at home work not at home ...
...
I tried the following, but my knowledge with do repeat /do if does not seem
to be sufficient, because basically nothing happens. It might have to do
with the stand-in variables!
DO REPEAT akt = zha1 to zha288 /wo = zwo1 to zwo288.
DO IF (akt = 1030) AND (wo = 1).
RECODE zwo1 TO zwo288 (1 = 3000).
ELSE IF (akt = 1030) AND (wo = 2).
RECODE zwo1 to zwo288 (2 = 3001).
END IF.
END REPEAT.
Or is it better to create 288 new variables for that problem? How would that
work?
Thank you,
Hans-Peter Schmid
Deutsches Zentrum für Luft- und Raumfahrt e.V. (DLR)
in der Helmholtz-Gemeinschaft
Institut für Verkehrsforschung (IVF)
Rutherfordstraße 2
12489 Berlin
Tel: +49 (0)30/670 55-153
Fax: +49 (0)30/67055-202
Internet: <http://www.dlr.de/ivf>