Combining 4 Variables into 1 - Only certain answers

Moderators: statman, Analyst Techy, andris, Fierce, GerineL, Smash

jlimoges
Posts: 8
Joined: Mon Dec 10, 2007 10:12 pm

Combining 4 Variables into 1 - Only certain answers

Postby jlimoges » Tue May 06, 2008 3:34 pm

Hi All,

I know this has been posted before, but I can't figure out how to get the syntax working for me in this case. I essentially need to create a new variable out of 4. It is one question on a questionnaire, but it allowed for multiple responses, all different entries on SPSS (d7a, d7b, etc.). I need to combine the 4 variables into 1, but only if the respondents answered 2, 3, or 4 for any of them.

So how do I create a new variable if d7a-d = 2,3,4 d7_Index = 1? Thanks!
statman
Administrator
Posts: 2721
Joined: Tue Jun 12, 2007 12:08 pm
Location: Florida, USA

Postby statman » Tue May 06, 2008 5:10 pm

Use a filter of Select IF
See the note below

NOTE: Please read the Posting Guidelines and always tell us your OS, the SPSS version and information about your study and data!

Statman
Statistical Services
jlimoges
Posts: 8
Joined: Mon Dec 10, 2007 10:12 pm

Postby jlimoges » Tue May 06, 2008 5:26 pm

I'm not sure I understand... a filter of IF for what? Could you give me an example of how I might do this in syntax?
statman
Administrator
Posts: 2721
Joined: Tue Jun 12, 2007 12:08 pm
Location: Florida, USA

Postby statman » Tue May 06, 2008 5:34 pm

Code: Select all

Select IF((d7a_d = 2 | d7a_d = 3 | d7a_d = 4) & d7_Index = 1).
All cases that don't fit are dropped so remember when go to save the file

Untested

Who is online

Users browsing this forum: No registered users and 1 guest

cron