Hello, inexperienced user here. I have a dataset (provided as .dtas) of 5 waves and 300 variables sourced from a questionnaire, which I would like to combine to create a longitudinal panel dataset. However, while the variables are the same in content, they are all named after the question number in their year's questionnaire, and questions are often asked in different orders. For example, every wave has a gender variable, but 2016's is named "q3" and 2017's is named "q11". As such, I need to rename each wave's variables before I can combine them. However, instead of just renaming them "var1, var2, var3" etc, I would like to rename them "age, gender, birth_city" and so on. This prevents me from using loops to generate new variable names as I have seen in many of the other queries here regarding renaming.
I am aware of the rename command's "rename group" feature. However, with 300 variables, the command looks like a solid wall of text. Is there any easier way to, for example, import variable names as a .csv and replace them? Or is my only option the 50-line rename?
Would appreciate any advice!
I am aware of the rename command's "rename group" feature. However, with 300 variables, the command looks like a solid wall of text. Is there any easier way to, for example, import variable names as a .csv and replace them? Or is my only option the 50-line rename?
Would appreciate any advice!
Comment