Page 1 of 1

Create data in spss with the syntax editor

Posted: Mon Sep 25, 2017 9:36 pm
by Bropamht
Hi everyone, I'm a new spss user. I have a problem, i have to a new variable with an old one witch is a string variable. My syntax should do this :

If (OldVariable contain 'text')
Do{
NewVariable =1;
}else {
NewVariable = 0;
}

Text is a part of the string in the fields of OldVariable

I tried all I knew with no success, so if anyone can write the appropriate syntax for me this would be great! Thanks ya'll.

Re: Create data in spss with the syntax editor

Posted: Tue Sep 26, 2017 12:09 pm
by statman
Need more like .......

Re: Create data in spss with the syntax editor

Posted: Wed Sep 27, 2017 9:23 am
by Bropamht
Sorry!!!

OS : Windows 10.
Version : SPSS 23.
My study concern the knowledge of the new baby's mother about nutrition, so the guy who was responsible of the survey made a mistake on extracting the data from the server.
that's make the "multiple choice questions" (i don't know if it's the correct way to say it but it's like check box choice in html) have many different answers in the same cell of one variable. so i want to split this variable in binary variable for each answer, for that i have to indentify the cells who have a specific part of text to create these binary variable to continue the analyse.

Re: Create data in spss with the syntax editor

Posted: Tue Oct 31, 2017 8:14 am
by IsaacWi
Did you solve your problem? I think the same syntax would work for me too.

Re: Create data in spss with the syntax editor

Posted: Thu Nov 02, 2017 12:57 pm
by statman
So you have several responses to 1 question? The person can enter several different answers, e.g., What do you look for in a car? Answers could be 'color,' 'transmission,' 'style,' ...... all then loaded into separate fields?