Hallo,
vielen Dank für die Hilfeversuche. Allerdings denke ich, dass ich vielleicht mein Problem noch nicht richtig formuliert habe (es kann auch gut sein, dass ich die Antworten nicht verstehe. SORRY dafür, falls es so ist
)
Ich möchte dies erreichen (das farbig unterlegte nur als Beispiel, wie ich es mir vorstelle):
RECODE Variable A
IF age<5 (3=2) (0 thru 2=1) (4 thru 10=3)
OR IF age>4 (4=2) (0 thru 3=1) (5 thru 10=3) INTO Variable B
VARIABLE LABELS Variable B 'Variable B'
EXECUTE.
Ich möchte als eine Variable umkodieren in Abhängigkeit einer weiteren Variable. Geht das?
Momentan sieht meine ewig lange Syntax so aus (verkürzt, da hier ursprüngliche Werte von 0-40):
DO IF (age<5 and e_ges_score=0) AND (age<5 and e_ges_score=1) AND (age<5 and e_ges_score=2) AND (age<5 and e_ges_score=3).
COMPUTE ges_new=1.
ELSE IF (age<5 and e_ges_score=4) AND age<5 and e_ges_score=5) AND (age<5 and e_ges_score=6) AND (age<5 and e_ges_score=7).
COMPUTE ges_new=1.
ELSE IF (age<5 and e_ges_score=8) AND (age<5 and e_ges_score=9) AND (age<5 and e_ges_score=10) AND (age<5 and e_ges_score=11).
COMPUTE ges_new=1.
ELSE IF (age<5 and e_ges_score=12).
COMPUTE ges_new=1.
ELSE IF (age<5 and e_ges_score=13) AND (age<5 and e_ges_score=14) AND (age<5 and e_ges_score=15).
COMPUTE ges_new=2.
ELSE IF age<5 and e_ges_score=16)
"17-39" AND (age_anthro_ref<5 and e_sdq_d00149_ges_score=40).
COMPUTE ges_new=3
ELSE IF (age>=5 and e_ges_score=0) AND (age>=5 and e_ges_score=1) AND (age>=5 and e_ges_score=2) AND (age>=5 and e_ges_score=3).
COMPUTE ges_new=1.
ELSE IF (age>=5 and e_ges_score=4) AND (age>=5 and e_ges_score=5) AND (age>=5 and e_ges_score=6) AND (age>=5 and e_ges_score=7).
COMPUTE ges_new=1.
ELSE IF (age>=5 and e_ges_score=8) AND (age>=5 and e_ges_score=9) AND (age>=5 and e_ges_score=10) AND (age>=5 and e_ges_score=11).
COMPUTE ges_new=1.
ELSE IF (age>=5 and e_ges_score=12) AND (age>=5 and e_ges_score=13).
COMPUTE ges_new=1.
ELSE IF (age>=5 and e_ges_score=14) AND (age>=5 and e_ges_score=15) AND (age>=5 and e_ges_score=16).
COMPUTE ges_new=2.
ELSE IF (age>=5 and e_ges_score=17) AND (age>=5 and e_ges_score=18) AND (age>=5 and e_ges_score=18).
COMPUTE ges_new = 3.
ELSE IF (age>=5 and e_ges_score=19) AND
"17-39" AND (age_anthro_ref>4.99 and e_sdq_d00149_ges_score=40).
COMPUTE ges_new = 3.
END IF.
EXECUTE.
Das wird auch berechnet von SPSS. Allerdings zeigt das Ergebnis nur ganz wenig "1" an und der Rest wird als "2" codiert. Die Kategore "3" kommt überhaupt nicht vor. Hat jemand eine Ahnung, wo der Fehler liegen könnte?