Well, Hello Everyone, this will be my first post. I am a german student of sociology and i am supposed to work for one of my lecturers. It is basically the first time i am using SPSS but i have to work with a rather complex, huge dataset (
http://www.share-project.org/sharelife/).
I have to deal with the following problem. The interview data consists of hundreds of variables, interviewees were sometimes asked the same question several times, e. g. "In which year did you start your [first/next] paid job (as employee or self employed), which lasted for 6 months or more?" Intrviewees were asked this question as often as they started new paid jobs during theire lives.
As a consequence out of this there are lots of variables which are almost labelled identically, e.g. sl_ac006_1, sl_ac006_2, sl_ac005_6, sl_ac006_6 and so on.
I want to make use of this. The following syntax is a simplified example of what i am doing right now. You do not have to pay attention to the compute expressions but to the variable names, specifically the endings.
Quote:
do if (sl_ac006_5 GE umzuegealter and sl_ac005_5 EQ 1).
COMPUTE umzuege = umzuege + 1.
end if.
do IF (sl_ac006_6 GE umzuegealter and sl_ac005_6 EQ 1).
COMPUTE umzuege = umzuege + 1.
End if.
do if (sl_ac006_7 GE umzuegealter and sl_ac005_7 EQ 1).
COMPUTE umzuege = umzuege + 1.
end if.
I am searching for an possibilty code an index that will replace the end of my variable names with an index in order to create a general loop syntax that might somehow look like this. I hope you get the idea.
Quote:
LOOP #i=5 TO 7.
DOIF (sl_ac005_#i GE umzuegealter and sl_ac006_#i)
Compute umzuege = umzuege + 1.
end if.
(I already tried very weird conversions of the variable names and and an numeric index into a string variable using the CONCAT command but i gave up.)
Perhaps you can give me some advice how to solve this problem. There are lots of variables with indexes i have to work with and a solution might save me alot of time and trouble.
Jan