New variables can be created based on the values of existing variables. For example, this can be used to recode variables that have been "reverse coded".
Step 1: Click the “Transform” tab on the top of the SPSS Window, then click “Recode Into Different Variables" (Note: it is always recommended to recode into different variables to preserve your original data):
Step 2: Highlight the variable you wish to recode and click on the arrow to move the highlighted variable to the box on the right. Type a name for your new variable in text box labeled “Name” on the right-hand side of the window, then click “Change” to successfully make the change:
Step 3: Click “Old and New Values”, this will bring you to another window. There will be a set of options to choose from in the window labeled “Old Values”:
System-missing: When there is no data recorded for a certain cell. These cells will often look like this “.”
System- or user-missing: Same as "System-missing", except it includes data that the user may have missed
Range: Allows you to select a range of values you wish to recode, for example, “5 through 7”
Range, lowest through value: Allow you to code all values from the lowest value in your data up to a certain value, for example, “lowest through 3”
Range, highest through value: Same as above, except codes from the highest value in your data to a certain number, for example, “highest through 6”
All other values: any value you have not defined
Step 4: For each “Old Value”, type in the new value in the “New Value” box. In many cases, you will just want to specify how you want all of the ranges of values in your orginal variable to be coded in your new variable.
After each value or range is specified click “Add” and continue until all the values from your original variable are recoded
Note: Even if you are recoding a value into the same value (e.g., 3 → 3) you must add it to the “Old→New” box or SPSS will code it as system-missing in the new variable
Click "Continue" and "OK" when all to-be-recoded values have been specified
Your new variable should appear as a new column in your datafile. Here "Age" has been recoded into the categorical variable "New_Age":
New variables can be calculated based on the values of other variables.
Step 1: Click the “Transform” tab on the top of the SPSS Window, then “Compute Variable”:
Step 2: Type in the name of your new variable in text box labeled “Target Variable”.
Use a new, not already used name to create a new variable
Use an existing variable name to populate it the computed values. Note that this will overwrite the existing values for that variable.
Use the interface to compute the new variable any way you'd like:
Step 3: Click OK to computer your new variable, which will appear as a column in your dataset:
Optionally, if you only want to compute the new variable for specific cases, before clicking OK, click “If”, then select “include if case satisfies condition”. Use the interface to select specific cases:
And now the new variable is only computed for cases satisfied by your specified condition:
Select Cases excludes parts of the dataset based on the values of certain variables in the dataset. All analyses run after using Select Cases will only include the selected subset of the data.
Step 1: Click on “Data,” and “Select Cases”:
Step 2: Select “If condition is satisfied”, then click “If…” underneath:
Step 3: Use the interface to select a subset of your data. Variables from your dataset can be used to define the subset. For example, if we are only interested in participants with less than 3 siblings, we would use “Siblings <= 2”:
Click "continue" and "OK" to select the subset. Unselected cases will disappear from your dataset, but they can be restored by selecting "All Cases".
Note: To see the excluded cases, hold down "Control" and click anywhere on your dataset, then uncheck "Hide excluded cases".
Splitting the file allows to run the same analysis separately for people in different groups. For example, you may want to compare men and women on their anxiety scores (independent samples t-test), but you want to do this same analysis three separate times: once for men and women living in cities, once for men and women living in the suburbs, and once for men and women living in the country.
Step 1: Click on “Data,” and “Split File”.
Note: Be careful not to select "Split into Files":
Step 2: Select “Organize output by groups” and move the variable you will use to split the file into the box on the right, then click OK:
For any analysis run after using the Split File function, the output will show the results for each level of the variable selected in Step 2. For example, this is how the descriptive statistics for the variable "Height" would appear when the file has been split by the variable "Breakfast", which has values "yes" and "no":