Combining variables

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

Posts: 1
Joined: Fri Jan 30, 2015 8:15 pm

Combining variables

Postby hreutte » Fri Jan 30, 2015 8:21 pm

SPSS conundrum: I have 13 variables in a very large data set that all ask what type of training did you receive? And the answer is a 1 or a 2. The reason for the 13 variables is one for each training session the respondent may have received over time. Many times not all 13 variables have data. I want to combine the 13 variables into 1 variable. If there is a response for variable #13 and #12 I want the data in #13 to be used and the data in #12 to be discarded and so on so that the data in variable #1 is only used if 2-13 are blank. Does anyone know how to merge variables like this in SPSS? Just being able to merge two of the variables would be helpful.
Posts: 1477
Joined: Tue Jun 10, 2008 4:50 pm

Re: Combining variables

Postby GerineL » Mon Feb 02, 2015 11:44 am

Not entirely sure what you mean, but I think If-functions will give you the answer you need.

For instance:

if (v12 > .1) v13 = v12.

this says: if the value in V12 is bigger than .01, give v13 the value of v12.

2 pieces of advice:
- save a temporary dataset before you start playing around with these things.
- think very well ahead how you want to combine the variables. Be very specific in the "rules" you want to use (e.g., in the example above: what do you want your new variable to say if both v12 and v13 hold a value?)

Who is online

Users browsing this forum: No registered users and 2 guests