RENAME VARIABLES. Changing variable names manually in variable view is a bad idea because you can’t keep track of what you did. This tutorial shows a better alternative.
Changing Variable Names in SPSS
- Changing variable names with syntax is straightforward with the
RENAME VARIABLEScommand. - The main thing to keep in mind is that you should use parentheses when you rename more than one variable at once.
- Second, make sure that renaming variables does not result in duplicate variable names.
- Existing variable names may be used as new variable names if they’re renamed themselves within the same command. So for instance,
RENAME (v1 v2 = v2 v1).will work.
SPSS Rename Variables Syntax Examples
(The test data used by the syntax below are found here.)
*1. Basic variable renaming.
rename variables name = first_name.
rename variables married= marital_status.
rename variables name = first_name.
rename variables married= marital_status.
*2. Rename both variables back to their original names (undo previous 2 commands).
rename variables (first_name marital_status = name married).
