Recoding Variables in SPSS Menus and Syntax

SPSS offers two choices under the recode command: Into Same Variable and Into Different Variables.

The command Into Same Variable replaces existing data with new values, but the command Into Different Variables adds a new variable to the data set.

In almost every situation, you want to use Into Different Variables. Recoding Into Same Variables replaces the values in the existing variable.

So if you notice a mistake after you’ve recoded, you can’t fix it.

But you may not even notice the mistake, because you can’t even test it.

And that’s just dangerous.

So do not recode over an existing variable unless you are absolutely certain that the lost information will never be needed.

Here is an example of how to do it in the menus.  This is from the General Social Survey data set that comes along with SPSS.  In it, I am recoding Educ, Years of Education, into 5 categories: Less than High School, High School Grad, Some College, Bachelor’s degree, More than college.

Transform

Recode  Into Different Variables

This dialog window will come up:

I filled in the following:

Numeric variable: Educ

Output variable Name: Educ_Cat

Output variable Label: Education in Categories

Click Change

Click Old and New Values

This Dialogue Window will pop up:

Fill in the following:

Old Value: Range: Lowest Through: 11

New Value: Value: 1

Click Add

Old Value: Value 12

New Value: Value: 2

Click Add

Old Value: Range: 13 Through: 15

New Value: Value: 3

Click Add

Old Value: Value: 16

New Value: Value: 4

Click Add

Old Value: Range: 17 Through Highest

New Value: Value: 5

Click Add

Old Value: System- or User-Missing

New Value: System Missing

Click Continue

Click OK
Or, you could do all of that in just a few lines of very logical syntax code:

RECODE educ (12=2) (16=4) (MISSING=SYSMIS) (Lowest thru 11=1) (13 thru 15=3) (17 thru Highest=5) INTO Educ_cat.
VARIABLE LABELS  Educ_cat ‘Education in Categories’.
EXECUTE.

If you don’t have many variables to recode, say one or two, it’s not a big deal to use the menus (but at least paste the code, so you have a record of what you did later!).

But if you have more than just one or two, all those mouse-clicks get old, fast.

And if you need to go back and change your coding scheme, say to combine two small categories, it’s a quick matter to update the code.  In the menus you have to start over.

(And of course, once you recode, you should immediately enter value labels and test your syntax to make sure it worked.  Both are easy to do with syntax).

Want to learn more? If you’re just getting started with data analysis in SPSS, or would like a thorough refresher, please join us in our online workshop Introduction to Data Analysis in SPSS.

 

Getting Started with SPSS
Karen will introduce you to how SPSS is set up, some hidden features to make it easier to use, and some practical tips.

Reader Interactions

Comments

  1. Mixi says

    1. Imported Data
    2. Recoded variables into new variables
    How do I add more data into the sheet?
    If I do a simple copy paste value is not being generated for the recoded variables. Help !!

  2. Nummy says

    hi
    i have spss sheet.and i make variable from different items now i have loss output file and dont know about the items of the variable. how i know about the items. variable are developed already…

  3. Priya says

    hi,
    my doubt is this.

    i have a dataset where I want to assess if there is any association between waisthip ratio and gender. the problem is the cut offs for WHR are different for males and females. how do i perform a chi square here.

    thanks,
    priya

  4. Legha says

    Hi,

    I have created a factor variable FAC1_1 by factor analysis, but it is in the ‘standard’ (Z) format with the mean of 0. I need to rescale it to 0-10 values. Could you please advice how to do that? Thank you.

    Regards,
    Legha

  5. teo says

    hi,
    first of all, thank you for the information in your website.
    I am facing a problem with spss. my lecturer asked us to recode two variables (sex, ethnicity)into one.
    sex is coded:
    0=female, 1= male.
    ethnicity is coded:
    dutch=1, hindu=2.
    now i have to merge these two variables into one and produce 4 categories :
    1= male hindu, 2= female hindu, 3= male dutch, 4 female dutch.
    I have tried by computing a new variable but then the fourth category does not appear in the Output. what should i do?
    thank you
    teo

  6. Shawn says

    I have a longitudinal dataset set in long format. I’m trying to create a variable that is a function of the previous day’s response. How do I get the LAG function to provide the ‘next-day’ lag for EACH participant? When I originally ran it, it treated the entire dataset as one entity (such that Person X’s last day response was treated as the lag for Person Y’s first day response). Any advice?

    • Karen says

      Hi Shawn,

      Yes, include an “if lag(subid) = subid” in your calculation. That way it will only calculate it if the subid’s are the same. This, of course, requires the data to be sorted correctly.

  7. Patrick says

    iam still new statistic analysis iam getting a big problem in creating the dependent variables in SPSS i have through looking for materials and i found one very useful in categorical variable and continuous dependent variable.

    But iam getting confused when enter data view you get scores for dependent variable where does those come from?

  8. Ruby says

    Hi Karen,

    I am doing a 2×2 factorial ANOVA and am expecting to get a significant interaction effect. After that I am testing whether the interaction effect is mediated by another variable (a continuous variable).

    I was wondering should I dummy code this interaction so I can use it in a regression equation to carry out the mediation analysis using the PROCESS custom dialog box. If so how would I go about dummy coding an interaction in SPSS? Or should I use effect coding in this instance and if so how do I use effect coding for an interaction?

    Thank you,
    Ruby

  9. DAFAALLAH says

    Hi,
    I need your advice about the proper way of coding and recording the different types of variables (1- categorical (binary, nominal..) 2-continuous variables (interval -ratio), please can you give an example of that.

    Also,can you tell witch of the following coding is correct? and why?
    15 Where do you usually smoke marijuana ?
    1 I never smoke marijuana
    2 At home
    3 At the cafe
    4 At the restaurant
    5 At the club

    When you count all the marijuana that you have ever smoked during your life, how many have you smoked?

    1 0
    2 Between 0 and 1
    3 1-4
    4 5-24
    5 24 or more

    Regards

  10. Alisha says

    Hi,
    After downloading my survey to SPSS, I noticed my values for yes/no questions were 1=yes and 2=no. Should the 0-no instead? I’m aware of how to recode into same variables but was unsure if it made a difference in recoding the 2 to a 0.
    Thanks

  11. claire says

    Hi there,

    I have a data set (questionnaire results) that a lot of respondents have missed out whole questionnaires so I want to compare via t-test or ANOVA whether the people who responded to only some questions (mainly just the initial demographics) differ from those who responded to all the questions.

    I’ve tried this method but cant get anywhere, any help would be really appreciated.

    Claire 🙂

  12. adnan baloch says

    I need your help in just a simplest manner teach me to re code data into different variable using if cases, if u could do this by sending to me a very easiest example it will be great to me!

    thank you.

  13. Amado says

    I have a problem in recording the growth value in SPSS as some of these values are negative for example -.085 What can I do.
    Thanks

  14. Mary says

    Hi there

    Desperately trying to work out why, after following several different tutorials on completing reverse-coded variable values, “Execute” keeps coming up in the output syntax after I have recoded all the variables and pressed, “Continue” and “Ok”…and my variables stay the same, i.e. no reverse-coding achieved! I have no idea why it’s not working. Any help would be super appreciated. Thanks.

    • Karen says

      HI Mary,

      Are you running the Execute command as well as the recode? The recode won’t happen until you run Execute. Or are you just using menus?

  15. Keren says

    Hi, I need to create a variable that is based on multiple lines (cases). for example, if I have 5 lines with identical case number, I want the new variable to code the first line (case) as 1 and the remaining 4 lines (cases) as 0. Is it possible in SPSS? would appreciate guidance.
    Thanks!

    • Karen says

      Hi Keren,

      Yes, you can do it in syntax using the lag function.

      This is how I would do it. Note that I’m not testing this code, but it should put you on the right track.

      I’m assuming your case variable is caseid and new variable is newvar.
      sort cases by caseid.
      if caseid~=lag(caseid) newvar=1.
      if caseid=lag(caseid) newvar=0.

      I would look up lag in the Command Syntax Reference to get more examples.

  16. Sam says

    I could use a little help in SPSS. I exported my data into excel from an interviewing program, and uploaded it into SPSS. Then I realized that I forgot a question in the interview, luckily it is similar to another question so I am going to have the two variables be the same (ex. VAR1=Var2). Is there a way to write syntax or some kind of command that will go in, find the variable and make it the same as variable 2? Someone please help, if you need more explanation let me know.
    Thank you!

  17. kattia says

    when i have an negative variable like destroyed ideas, can i code it by negative numbers?
    -1, -2,-3, …
    thank you

  18. Rachel says

    Hi, I each variable recorded as a human tooth. Each variable too is coded as 0=present, 1=Absent. I would like to combine all of the variables (teeth) so that I can run Chi Square analysis between sexes, over time etc for the total number of teeth in an individual’s mouth (each case). I can’t figure out how to combine them. It doesn’t seem to work when I try to sum them.

    Help? 🙁

  19. Noara says

    Hi
    How I can use information in two columns in SPSS(e.g, schools and Grades) using SPSS RECORD option to code them in a different variable. For example, if a person is in school X and Grad Y is coded as 1, and the same for all other schools and grades.

    • Karen says

      Hi Noara,

      You need to use an IF statement. If you’re in the menus, I think you may have to use COMPUTE instead of Recode. In the menus, there is a small box at the bottom of the Compute dialog window that says IF. You have to use that to say, for example

      if school=1 and GradY=1 NewVariable=1.

      • Noara says

        Hi Karen,
        Thank you so much for the reply.
        I tried COMPUTE option but I kept getting this error message when I use IF command: “Incorrect variable name: either the name is more than 64 characters, or it is not defined by a previous command”.
        Is that possible that my variables are STRING? E.g., school column contains schools names and for Grades I have STRING G1, G2,…. and so on. Please note that I define my new variable as STRING using TYPE & LABLE OPTION. Any suggestion would be appreciated.
        Thanks

      • Noara says

        Hi Karen,
        Thank you so much for your previous reply.
        I tried COMPUTE option but I kept getting this error message when I use IF command: “Incorrect variable name: either the name is more than 64 characters, or it is not defined by a previous command”.
        Is it because my variables are STRING? E.g., school column contains schools names and for Grades I have STRING G1, G2,…. and so on. Please note that I define my new variable as STRING using TYPE & LABLE OPTION but still I am getting errors. Any suggestion would be appreciated.
        Thanks

  20. Anna says

    Hello Karen,

    I have 6 variables that are measured with 6-point Likert scale, however I would like to turn them into 2 variables, and did it according to your instructions:
    1 thru 3 = 2 (disagree)
    4 thru 6 = 5 (agree)

    When I apply pie chart, one of the variables present all the data (n=162), however the remaining 5 are missing data. Besides, each of these variables are missing another amount of data. I am very confused. What could have caused this?

    Thank you,

    Anna

  21. tarz says

    hie
    im new to spss, wanted help on how to rank mutiple responses not basing on their occurance but basing on there positions. I hope you help- im really stuck

  22. Bikila says

    hello
    I have a question that I Collected data on all children in household and inserted them as first, second,third…etc and faced difficulty of analysis.can you help me

  23. Aliya says

    Hi
    I would like to recode an old variable (numeric) into a new variable (string) that is the label of the old variable. Is there a way to do this in spss (I am using spss 9)?
    My old variable is a list of foods (codes) with variable labels. My new variable will be a list of foods (by name: labels of the old variable). I need to do this to facilitate control of some other variables depending on each food.

    • Karen says

      Yes. There’s a string button in the “Recode into Different Variables” dialog box.

      There’s also a detailed section in the Command Syntax Reference to convert Numeric to String variables in syntax. I would start there.

      • Kricks says

        Hi Karen,

        I need a small help on of the recode.

        actually we have 7 variables which have data
        A B C D E F G – Variables
        84 64 34 45 23 10 92 – Actual data
        2 3 5 4 6 7 1 – Recode…(assigning highest rank)

        we need these recodes into new variables. is this possible in the SPSS.
        If so could you please let us know the syntax…

        advance thanks for your help!!

        • Karen says

          Hi Kricks,

          There is a Rank function in SPSS. I couldn’t give you the exact code without trying it, but look it up in the Command Syntax Reference.

          • Kricks says

            Thanks Karen,

            We have tried that one but it is assign rank in same variable..we need to compare all the columns and assign highest rank to specified column same as other variables…

            A B C
            90 50 80

            We need like
            A1 B1 C1
            1 3 2

  24. Sid says

    Hi Karen,

    I have a gigantic file with a lot of subjects. I need to create a new variable that is dependent on certain subjects, in no logical order. So, for example, the new variable should be 0 for subjects 1013, 1025, 2001 and 3004, and should be 1 for subjects 1003, 1021, 2017 and 3012. I have the subject numbers sorted bij condition in an Excel spreasheet, so I could copy the numbers from there.

    SPSS, of course, has the option to recode into new variable. However, I can not find a way to copy the subject numbers into the recode dialog. This means I have to recode for every subject number by hand. Is there a way to make life easier in SPSS? Or should I look into a macro for Excel?

    Thanks in advance for any advice.

    • Karen says

      Hi Sid,

      Is there a variable that is defining which subjects get which value of the new variable, or is it just certain subject numbers?

      If you have the subject ids as a variable, you can definitely use them in the recode. This is a case where using syntax would be much, much easier. Also, think about whether using Compute would be easier than Recode.

      For example, you could say ” If Subid=ANY(1013, 1025, 2001, 3004) (Newvar=0). That kind of statement.

  25. WC says

    Hi Karen,

    I have seven complication variables (comp1 – comp7) each with dummy coding of “1” for “has complication” and “0” for “no complication”. I want to create a separate variable called “number of complications” that will show the cumulative frequency of complications from these 7 complications (0-7). How should I approach this?
    Thank you very much

  26. Roya says

    Hi, I’m new in SPSS. I don’t know how to activate a written syntax in spss.
    ex:
    RECODE API (Lowest thru 50=Good) (51 thru 100=Moderate) (101 thru 150=Unhealthy for Sensitive Group)
    (151 thru 200=Unhealthy) (200 thru 300=Very Unhealthy) (301 thru Highest=Hazardous) (MISSING=NA)
    INTO AQILH.
    VARIABLE LABELS AQILH ‘Air Quality Index Health Level’.
    EXECUTE
    then ho it will work for my file or other file in future?
    Thanks, Roya

    • Karen says

      Hi Roya,

      Rather than use Good, Moderate, etc. for your new values, I would suggest using numerical values, like 1, 2, 3. You can do what you’re trying to do, but because they’re character strings, not numbers, you have to make a few changes.

      So you’ll have to put each one within single quotes, so it would look like:

      RECODE API (Lowest thru 50=’Good’) (51 thru 100=’Moderate’) etc.

      You will also have to declare your new variable, AQILH as a string variable before you begin the recode. That one I don’t remember off the top of my head, so I’ll let you look it up. 🙂

      • Roya says

        Thank you Karen, I appreciate for very useful tips.
        Now my problem really is:
        Suppose I write a data file, then I want to create a new variable (recode),
        how I should introduce syntax file to this data file? I mean how it identify my syntax file which is saved in any corner of my computer?
        thanks in advance, Roya

  27. Kristine says

    I’m having trouble recoding a variable consisting of 10-digit numbers into even and uneven. When defining old and new values is it possible to use a “joker” (old value: *********1 -> new value: 0, old value: *********3 -> new value: 0, old value: *********2 -> new value: 1 and so forth, recoding all the 10-digit numbers into 0’s and 1’s)
    I obviously tried using * but it didn’t work.

    • Karen says

      Hi Kristine,

      I know you can do something like what you’re trying to do with the substring function of a string variable. But I don’t know if that’s an option if it’s numerical.

      There are many different ways to approach something like this, but I would be tempted to use the truncate function to do this.

      If trunc(Variable/2) = Variable/2 Even=1.
      If trunc(Variable/2) ~= Variable/2 Even=0.

      I haven’t tested this (so it may not work as written), but the logic is that for an even number, if you divide by 2, there will be no remainder to truncate off. For an odd there will be. Look under Compute for the exact syntax of the function.

  28. Rae says

    I am recoding some of my data into different variables – I’ve done a bit of it already and I’ve no problems with the basics. But now I need to do industrial amounts of recoding and I’m wondering if there’s a way of saving any time/ work – i.e. is there a copy and paste mechanism within the recoding function?

    To explain, I have done a content analysis of a local newspaper. I wanted to find out what kind of people (sources) are quoted in articles. I have 9 identical categories for ‘Source’, which captured what kind of people were quoted in newspaper articles and also where geographically they were from. I have 10 geographical areas, and 20 types of person. That gives me 200 variables in the Source category. I have 9 identical Source categories (Source1, Source2 etc, as there could be many people quoted in an article).

    I need to recode each of these Source categories twice so that I can group the variables firstly by geography, then by the type of person.

    I have recoded Source1 for geography, which gives me a long list of variable numbers (eg 1->1, 11->1) – this list would be identical for my other categories, Source2, Source3 etc. Is there a way of copying the list to save my typing it all out each time? (Or I will be here for days!!!)

    Thanks!
    Rae

    • Rae says

      Ooh, never mind, I’ve figured it out! SPSS cleverly remembers all the recoding so you just have to go back to recode again, change the category names and, I guess, do it all in the same session so it doesn’t wipe the list.
      Thanks anyway!
      Rae

  29. Μάγια says

    Hi, i would like to help me with an exercise. I have done the recode ”into a different variable” and the result on the output it’s fine, i mean that i have not done any mistace with the categories. But when i want to see the frequencies (analyse–> descriptive statistics–> frequencies) i can’t see the categories from the output. Specifically appears only the first and the second category of the variable.

    DONT FORGET TO MENTION: this happens only with this variable. i can recode everyone else variable but not this one.

    Please help me!

    • Karen says

      Hi Magia,

      The only reason I can think of is if there weren’t any instances of those categories in the data.

      I find that using the “Case Summaries” is a good way to debug recoding problems.

  30. Simona says

    Hi,

    I have a questionnaire where a few items (measured on Likert scale) are supposed to measure the same factor,
    e.g. 3 items are measuring job stress, 2 items are measuring social support.
    Naturally, I’ve entered them separately to SPSS.
    1. Should I somehow assign them to the same factor? If yes, then how?
    2. What analysis should be used to find out the total effect (and separate) of those few items on that one factor their supposed to measure?

    Sorry, if these seem like dummy questions 🙂 I’ve so many more of them 😀

    • Karen says

      Hi Simona,

      Normally, you’d do a factor analysis to check if variables really are measuring the same factor and to understand their common and unique variance. However, you need a minimum of 3 variables per factor, so it’s best to have at least 5 per factor for the test. So I’m not sure you have the data to do it.

      If you have many questions, it may be useful for you to set up a Quick Question Consultation. I’d be happy to go over them with you. It’s amazing what we can get done in an hour. 🙂

  31. Naomi says

    Hi Karen,

    I’m trying to use only those that replied ‘yes’ to certain variables (9 diff preschool settings) and recode them into a new variable (setting: formal vs informal). if all the data was under a single variable then I know i could just recode via grouping (ex 1-5 =1, 6-9=2) but since it’s not, i’m totally lost. where do I start?

    thanks

    • Karen says

      Hi Naomi,

      This kind of data manipulation can get complex, so it’s hard to say without a lot of detail (it’s all in the details).

      But one trick is to code them all 0/1 where 0=no and 1=yes. Then summing them tells you how many yeses you have. Use the sum in an if…then statement.

      You often have to create some sort of intermediary variable that you use in your recode, even if the sum doesn’t work.

  32. Amar says

    I have a research about diabetes, and I want to test hypothesis that is female mean equal to male mean or not, I tried to do it in SPSS but always there is no result

    Warnings
    The GROUPS subcommand specifies an unknown variable or a long string variable. This subcommand must specify either a numeric variable or a short string variable. Text found: gender
    Execution of this command stops.

    can some one help me please?

    • Karen says

      Hi Amar,

      I assume you’re using the oneway ANOVA procedure. I was surprised by this one as well, many years ago.

      Despite the fact that the grouping variable should be categorical, it wants a numeric variable.

      My suggestion? Use GLM instead. Put that grouping variable into Fixed Factors. Does the same analysis, but without the hassle.

  33. Praneeth says

    Hi, Using principal component analysis of factor analysis I can load 4 items to 1 component. There I need to consider this loaded factor(component) as an independent variable in the further analysis. So how do I create variable for result factor of factor analysis.

    • Karen says

      Hi Praneeth,

      You stat software should have an option to save your factor scores as a new variable. Once you’ve saved this variable to the data set, you can use it in other analyses. If you are using SPSS, there is a save button within the factor analysis procedure.

  34. Wunna says

    hi,
    my question is how can I do in recoding “often true, and sometime true” to “Yes” for coding as 1. I want to combine the “often and sometimes” as “Yes” and “never and don’t know” as “No”. Then Yes=1 and No=1. Thank you for your time.

  35. jason says

    hello ,i have few questions want to ask about the spss
    first,when i use the “transform” ->”record into different variable” to make a new range
    ex.1~10 become 1
    10~20 become 2
    20~30 become 3
    when the data have the num 10 then it will come out at the “1”,why?
    second ,is
    ex.100~200
    201~300
    301~400
    when the data have the num 200.23 or other ,they will come out missing value,why?

    thank you

  36. John says

    Hi,
    I am trying to do analysis of my research data, but getting stuck! I really need help on how to do correlation analysis. How do i combine for instance 7 factors into one variable? I need to run a bi-variate corerlation but the several factors are disturbing me. Thanks.

    • Karen says

      Hi John, It sounds like you need to do a correlation matrix, which is a table of bivariate correlations between each pair of variables. You’ll have a LOT of correlations in that table.

  37. Lila says

    I have a very large data set (17 million records) where responses were free form and contains spelling errors and multiple ways to characterize the same compound. For example, Activated Charcoal comes up as ACTIVATED CHAR, activated charcaol, ACT. CHAR, etc. How would these be recoded into the same grouping? Would I be able to use “*.*”?

      • lILA says

        New to SPSS, could you provide a little more detail/reference on substring function? Is this done through a macro command or from the drop down menu in SPSS?

  38. Liz says

    Is there a way to transform a variable on one scale (a Likert from 1-7) to a different scale (1-9) without z-scoring?

  39. MAUREEN UU says

    Hello,
    I am new to spss and currently doing a secondary analysis using an existing data sets. I have two variables
    1.Partners drinks Alcohol? Yes/NO
    2.Frequency of getting drunk Never/Often/Sometimes
    I am trying to merge the NO category of variable 1 to 2 in order to obtain a 3rd variable
    3 Alcohol measure….NO/Never/Often/Sometimes.
    I will appreciate any help on how to go about this on spss 19.
    Thank you.

    • Karen says

      Hi Maureen, you need to use recode (in the transform menu) and it’s going to require a few If conditions.

      For example: if Partners=No Alcohol=No
      if Partner=Yes and Frequency=Never Alcohol=Never
      etc.

      There are a lot more steps along the same line–it would be hard to explain here (we do this in a workshop and it takes a while to show all the steps).

  40. orest says

    Hi!
    1) I have a dependent variable (Degree of empowerment -DoE)measured in 10 different dimensions using a 6-point likert scale. I would like to combine the 10 dimensions into a single measure of degree of empowerment (DoE). what approach I can use in spss?
    2)The independent vatiables: some are dichotomous (Yes/No) and others are also ordinal. I want to explore how they influence degree of empowerment (DoE) what analyses can I perform?
    Thanks,
    Orest

    • Karen says

      Hi Orest,

      The first sounds like either a Principal Component Analysis or an Exploratory Factor Analysis.

      The second sounds like a multiple regression (linear model). That’s where I would start, at least. If you’d like a consultation to go over it, let me know. 🙂

  41. John F Hall says

    If you made a mistake and didn’t spot it until later, it also helps to have saved the Data Editor with a different name: that way you can always go back to the previous version.

    There’s an example on my website of RECODE with reversed Likert scales from a survey of teenage attitudes, followed by analysis and some comments on the results (see:
    http://surveyresearch.weebly.com/23-data-transformations.html
    and especially
    http://surveyresearch.weebly.com/-35-derived-variables-count-and-compute.html

  42. Sitha says

    Hi Karen,

    I am brand new to SPSS trying to recode variables. Just needed to when im recoding multiple sets of variables does it change the values of other variables? I hope that makes sense

    • Karen says

      HI Sitha,

      As long as you choose “Recode into Different Variables” you are actually creating a new variable, so it should not change the values of any existing variables.

      Karen

  43. Ivan Carbonell says

    Hi:

    I am a very nervous (:) doctoral student who is trying to finish his data analysis using SPSS 20.0. I am having problems mergin two variables that should have been together (days/weeks). I learned how to transform the variables, but I am not sure if I can merge the two of them days an weeks. Days=1, and weeks=2. Right now I have two separate columns: Days 0=No, 1=Yes, and Weeks 0=No, 1=yes.

    Thanks,

    Ivan

    • Karen says

      Hi Ivan,

      I’m not sure what you’re trying to end up with. But it sounds like there are four possibilities:

      1. Days=Yes, Weeks=Yes
      2. Days=Yes, Weeks=No
      3. Days=No, Weeks=Yes
      4. Days=No, Weeks=No

      Do you want one variable with those four categories? Or somehow combine those four combinations into two?

      Karen

      • Nemanja says

        Dear Karen,

        I am interested in similar question. Namely, in my SPSS database I have 7 categorical variables (YES=1, NO=0), and I would like to create only two variables, where first three from those 7 should be in the FIRST NEW VARIABLE and four others sholud be in the SECOND NEW VARIABLE. Namely, i have 7 ways to reward employees, and first three are related to the so call profit sharing and other four are related to the bonuses, so I would like to create only two variables – instead of 7… Is this possible? Thank You in advance!

        Nemanja

        • Karen says

          Hi Nemanja,

          Sure. But how you do it depends what you want the new variables to measure. Should the first new variable be a count of the yeses across the first three variables? Or a Yes if any of the original three variables were yes?

          This is the first thing to figure out.

  44. Nadine says

    I have a few questions and I’m not 100% sure this is where I should be asking them.. I have a bunch of data that is in code form that I want to track on spss. There is about 10,000 different codes. I want to add the codes to spss as value lables and I also need to recode the existing data into 1,2,3,4,etc. What is the best way of doing this and is it possiable???

    • Karen says

      Hi Nadine,

      Both recoding and assigning value labels are possible.

      If you a lot of variables, you definitely want to use syntax to do both.

      The commands are RECODE and VALUE LABELS. If you look them up in the Command Syntax Reference manual. It’s in the Help as a pdf.

      Karen

    • Karen says

      Hi Farah,

      There is no way to tell for sure without a codebook. But if you see strange patterns (ie. one variable has a strong negative correlation whereas all others are strong positive), that’s a good sign. But that will only be a sign if the results are very clear.

      Best,
      Karen

  45. Dorla says

    I would like to create interval ratio variable from class+degree but how do i describe the new variable?

    • Karen says

      Hi Dorla,

      I’m only guessing that class and degree are categorical variables. You can’t get interval or ratio data for each person that is a combination of categorical variables, unless you mean something like “the number of people in each class with a certain degree.”

      So I’d need more info.

      Karen

  46. karim says

    Hello, I have a model : qualitative IV (with three odor conditions) and DV: quantitative and moderator variable metric (likert scale with several items from 1 to 7 degrees). my questions are:
    – When the MV is metric, do I have to recode the categorical variable before Testet moderation?
    – How to recode moderator variable (Likert scale) in class (high level vs. low) in spss when it is a single item or more?
    – In the general linear model variable moderating factor is it random?
    – When the interaction effect was significant between VM and IV on the DV, how do you know that one of the two terms of the MV that best explains the DV?

    I block a lot on this point and I need your help please. Thank you in advance.

    I need mostly spss procedures for testing moderation and transofrmation moderating variables.

    • Karen says

      Hi Karim,

      I’m going to answer your questions one at a time.

      1. No, and usually you don’t want to. You’re just throwing away information.
      2. You would do it using Transform–>Recode into Differerent Variable. But don’t do it anyway. 🙂
      3. No. If the moderating variable (MV) is a factor (i.e. categorical), just enter it into fixed factors. If it’s continuous, add it to Covariates. Then go to the Model tab to create an interaction between the IV and the MV. This will occur by default if both are factors, but not if one is continuous.
      4. By terms, I assume you mean the items you’re combining to create the MV. You don’t. By combining them, you’re making the assertion that the combination is the moderator, not the individual items. If you need to see the effect of each individual item, you need to put them in separately.

      And I would suggest taking a look at our webinars and workshop–we’ve got a lot of free ones, and there are quite a few on this topic. I think you’d find it helpful.

      Karen


Leave a Reply

Your email address will not be published. Required fields are marked *

Please note that, due to the large number of comments submitted, any questions on problems related to a personal study/project will not be answered. We suggest joining Statistically Speaking, where you have access to a private forum and more resources 24/7.