In SPSS, I don't like to recode variables into new variables: the new variables don't have any dictionary information such as variable/value labels or formats. Second, a recoded variable is appended to the end of the file but I rather have it in its original position.
Both problems are avoided by recoding into the same variables. However, I do like to compare the old and new values to see if everything went right. An easy way for doing so is first cloning a variable and then recoding the original variable into the same variable. The clone now serves as a backup to which I can compare the recoded result.
This tutorial presents a super easy tool for cloning one or many variables. It copies variables’ values plus all dictionary information (such as variable labels, value labels, user missing values and formats) from the original variables to the copies. Hence, it really “clones” variables except for their names. Give it a try. You'll love it.
How Does It Work?
- First, make sure you have the SPSS Python Essentials installed.
- Next, download and install the SPSS Clone Variables Tool. Note that this is an SPSS Extension Bundle.
- Open some data and navigate to .
- Specify the variables you'd like to clone and some prefix: the names for the cloned variables will consist of this prefix plus the original variable names. Click syntax. and run the pasted
- Clones of the variables you specified are now created in the active dataset.
- Clicking the tool's button will take you to this tutorial.
SPSS Clone Variables - Example 1
Those who want to give it a quick shot can download and open freelancers.sav. For cloning the first variable, id, we simply enter it into the first box.
We'll leave the second box unaltered. Now, clicking SPSSTUTORIALS CLONE VARIABLES VARIABLES ='id' PREFIX ='copy_'. Upon running this line of syntax, a new variable called copy_id appears in our data. Except for its name, it's an exact clone of its original counterpart, including its variable label.results in
SPSS Clone Variables - Example 2
Now let's clone the next two variables, gender and birthday. We can now copy-paste the line of syntax we just pasted and simply change it to SPSSTUTORIALS CLONE VARIABLES VARIABLES ='gender birthday' PREFIX ='copy_'. After running it, note that copy_birthday is a date variable just like its original counterpart.
SPSS Clone Variables - Example 3
Finally, we can clone an entire section of variables by using SPSS’ TO keyword. For instance, we can clone source_2010 through source_2014 by running SPSSTUTORIALS CLONE VARIABLES VARIABLES = 'source_2010 to source_2014' PREFIX ='copy_'.
It's as easy as that. I hope you'll like this tool as much as I do.
Thanks for reading!