How do I use syntax to rename variables in SPSS?
-
I have approximately 8000 variables that need renaming: about 2000 variables each in 4 different data files. I need to add a 2-digit prefix to each variable to indicate the census year the variable came from, i.e. I need to turn "population" into "95population" or "98population" in different data sets. However, 8000 variables is clearly too much for me to do by hand, so I need to write syntax that will add the 2 digits. I'm having problems because 1. not all the variables need renaming, so I need some way of telling SPSS at which variable to start/end renaming, and 2. they are different types of variables, and when I've tried using syntax to rename them so far SPSS seems to want me to define whether the variable is string, number, etc. Is there anything I can do that doesn't involve me writing variable-by-variable syntax? If I'm going to do that, I may as well just go through all the data files and do the renaming by hand. Advice would be appreciated! I'm a reasonably competent SPSS user, but am not at all familiar with SPSS syntax.
-
Answer:
I'm not familiar with what SPSS is. But I use Visual Studio. And for it I press Ctrl F. This finds whatever you with to. But you also see the option to Find And Replace and you get to choose whether you want this search (or search and replace) to be only in the opened document you're currently viewing, or all opened documents or documents in the entire project..etc. It's a possibility that the method is similar (or the same) for the program you're using. Give it a try. p.s. I just Googled it and it seems to be a complicated thing with SPSS. But here's one I found that seems a tad bit less complicated: http://www.ats.ucla.edu/stat/spss/code/renaming_variables_dynamically.htm James
Yahoo! Answers Visit the source
Related Q & A:
- How should I use Youtube API?Best solution by Stack Overflow
- How do I create a digital signature and how do I use it?Best solution by support.office.com
- Where do I find my Yahoo briefcase and how do I use it?Best solution by Yahoo! Answers
- How do i correct syntax error?Best solution by Yahoo! Answers
- How do I use chat when I am in a room?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.