Hi,
I am not completely sure, and it also depends on how you have exported your ODK data. I think ODK stores multiple choice variables in csv files in a text string where each value is separated from the next with a space. If that is so, then you can pick out the first answer by extracting its value using the char.substr function and convert it to a number. That is char.subsrt(method,1,1) will pick out the first, char.substr(method,3,1) will pick out the second and so on. You also need to convert to a number, and then check what answer it is. Thus, compute value1=number(char.substr(method,1,1),F2.0).
And so on. A more general method is obviously creating a loop and search for the spaces.
I probably have a macro around somewhere designed for CSPro output that more or less does the conversion.
Note that you can either use multiple dichotomies or multiple categories in multiple response sets in SPSS.
hth
------------------------------
Jon
------------------------------
Original Message:
Sent: Mon April 05, 2021 02:59 PM
From: Rick Marcantonio
Subject: Split observations / variables
Perhaps use RECODE:
RECODE Method_contr (1=1) (MISSING,SYSMIS=SYSMIS) (ELSE=0) into Condom_Pill.
RECODE Method_contr (2=1) (MISSING,SYSMIS=SYSMIS) (ELSE=0) into IUD.
RECODE Method_contr (3=1) (MISSING,SYSMIS=SYSMIS) (ELSE=0) into Implant_Other.
... etc.
EXECUTE.
------------------------------
Rick Marcantonio
Quality Assurance
IBM
Original Message:
Sent: Fri April 02, 2021 05:28 PM
From: Tesky Koba
Subject: Split observations / variables
Hello
I am blocked
I'm looking for how to separate the observations of a variable so that each observation becomes a new binary variable with 1 for saying yes and 0 for no.
Contraceptive method variable example
* ID. * * Method_contr *
1. IUD condom pill
2. IUD
3. Implant other
4. Mama condom
5. calendar other
These are multiple choice questions with odk (select_multiple). I'm trying to figure out how to separate it so that each method becomes a binary variable with 1 to say yes and 0 no
Thank you
------------------------------
Tesky Koba
------------------------------
#SPSSStatistics