Danke für die schnelle Antwort.
Habe deine Syntax probiert, bekomme leider einen haufen Fehlermeldungen. Ist sie evtl. nicht anwendbar auf schon umstrukturierte Daten?
Habe dir die Fehlermeldungen rauskopiert:
Code: Alles auswählen
1 DO REPEAT Unrecognized text appears on the DO REPEAT command. It will be ignored. Text: (
1 DO REPEAT Unrecognized text appears on the DO REPEAT command. It will be ignored. Text: (
1 DO REPEAT Unrecognized text appears on the DO REPEAT command. It will be ignored. Text: )
1 DO REPEAT Unrecognized text appears on the DO REPEAT command. It will be ignored. Text: )
1 DO REPEAT An equals sign appears in a variable or value list where it is not expected. It will be ignored. Text: =
1 DO REPEAT An equals sign appears in a variable or value list where it is not expected. It will be ignored. Text: =
3 IF Incorrect variable name: either the name is more than 64 characters, or it is not defined by a previous command. Text: #v
4 END REPEAT An END REPEAT command has appeared without a previous DO REPEAT command.
5 IF Incorrect variable name: either the name is more than 64 characters, or it is not defined by a previous command. Text: pantoprazol
6 SORT CASES BY An undefined variable name, or a scratch or system variable was specified in a variable list which accepts only standard variables. Check spelling and verify the existence of this variable. Text: pantoprazol_metoprolol
7 Frequencies Error in FREQUENCIES command.
Bei mir im richtigen Datensatz ist die heisst die Variable ID fallnr, die Variablen Var1.1 etc. substance.1, substance.2 etc. Der Wert "a" ist "pantoprazol" und der Wert "b" ist "metoprolol".
Ich habe dein Syntax also mit angaben meines richtigen Datensatzes ausgefüllt und so laufen lassen:
Code: Alles auswählen
DO REPEAT #v = substance.1 substance.2 substance.3 substance.4 substance.5 substance.6 substance.7 substance.8 substance.9 substance.10 substance.11 substance.12
IF LTRIM(RTRIM(#v)) = "pantoprazol" pantoprazol = 1.
IF LTRIM(RTRIM(#v)) = "metoprolol" metoprolol = 1.
END REPEAT.
IF SUM(pantoprazol,metoprolol) = 2 pantoprazol_metoprolol = 1.
SORT CASES BY pantoprazol_metoprolol(D) fallnr(A).
FREQ pantoprazol_metoprolol.
Ich benütze SPSS 18, falls das was zu Sache tut.
EDIT: Habe den
. vergessen nach den substance-Variablen. Jetzt haben sich die Fehlermeldungen auf diese reduziert:
EDIT2: Habe jetzt noch alle auch effektiv im Datensatz vorkommende substance-Variablen aufgelistet. Es kommt zwar noch immer unten angefügte Fehlermeldung, jedoch bekomme ich einen Frequency-Output und auch die drei neuen Variablen a, b und a_b mit scheinbar korrekten Werten (d.h. entweder 1 oder SYSMIS)
Code: Alles auswählen
DATASET ACTIVATE DatenSet7.
DO REPEAT #v = substance.1 substance.2 substance.3 substance.4 substance.5 substance.6 substance.7 substance.8 substance.9 substance.10 substance.11 substance.12.
>Warning # 141. Command name: _SLINE
>DO REPEAT has no effect on this command.
>Warning # 141. Command name: _SLINE
>DO REPEAT has no effect on this command.
DO REPEAT #v = substance.1 substance.2 substance.3 substance.4 substance.5 substance.6 substance.7 substance.8 substance.9 substance.10 substance.11 substance.12
substance.13 substance.14 substance.15 substance.16 substance.17 substance.18 substance.19 substance.20 substance.21 substance.22 substance.23 substance.24
substance.25 substance.26 substance.27 substance.28 substance.29 substance.30 substance.31 substance.32 substance.33 substance.34 substance.35 substance.36 substance.37.
>Error # 4530. Command name: DO REPEAT
>This command is not allowed inside the DO REPEAT/ END REPEAT facility. The
>command will be ignored.
>Execution of this command stops.
IF LTRIM(RTRIM(#v)) = "pantoprazol" pantoprazol = 1.
IF LTRIM(RTRIM(#v)) = "metoprolol" metoprolol = 1.
END REPEAT.
IF SUM(pantoprazol,metoprolol) = 2 pantoprazol_metoprolol = 1.
SORT CASES BY pantoprazol_metoprolol(D) fallnr(A).
FREQ pantoprazol_metoprolol.
Es scheint jetzt für meine Bedürfnisse zu funktionieren; vielen Dank für deine Hilfe!
Ich wäre dir dankbar, wenn du mir zum besseren Verständnis vielleicht noch die ausgegebenen Fehlermeldungen etwas genauer erörtern könntest, falls du Zeit & Lust hast

.
MfG