Dear users,
I was wondering about the following. I have a large dataset with many different variables (about 14,000). Now, I need to keep about 150 of them, the rest can be deleted (so I thought about using the 'keep' command).
One of the groups of variables that I have is s1age, s2age, ...., s14age. I need to keep only s5age, ..., s14age. Of course, I can write them down separately but the problem is that I need to do something similar for many variables so this would be very inconvenient. Also, ordering the variables sequentially will not work because there are going to be other variables in between. Anyone who knows a fast way to solve this?
Hope someone knows a solution to my problem.
Thanks in advance.
I was wondering about the following. I have a large dataset with many different variables (about 14,000). Now, I need to keep about 150 of them, the rest can be deleted (so I thought about using the 'keep' command).
One of the groups of variables that I have is s1age, s2age, ...., s14age. I need to keep only s5age, ..., s14age. Of course, I can write them down separately but the problem is that I need to do something similar for many variables so this would be very inconvenient. Also, ordering the variables sequentially will not work because there are going to be other variables in between. Anyone who knows a fast way to solve this?
Hope someone knows a solution to my problem.
Thanks in advance.
Comment