Dear all,
I have a data set which contains many variables e.g. with a country prefix: "mexiko_variablename", I would like to rename this variable without the name of the country in front of it.
the normal way would just be
rename mexiko_variablename variablename
However, I have plenty of those variables and I would like to do it with a loop. Can someone tell me how this loop would look like?
Many thanks in advance
Related Posts with rename variables with foreach (getting rid of prefix)
collect: rows and columns' name changed?I am trying to learn Stata's -collect- and to manipulate tables. I find the manipulating part hard. …
Graphic with graphs for sub catvars and overall graphHello, I want to create a graphic with multiple graphs for each sub catvar and also a graph that is…
How to add fixed effect in sureg Stata?Hi everyone, I have a question about how to add fixed effect in sureg and I wonder if anyone of you…
Why some global parameter is in { } while the others are not?Dear all, I'm helping my prof modify past code to adjust to the new dataset. It is my first time us…
Convert Scientific Notations (e-07) into Decimal NotationHi All, I have various observations in my dataset like- 1.40e+09, 1.57e-07. How to convert these s…
Subscribe to:
Post Comments (Atom)
0 Response to rename variables with foreach (getting rid of prefix)
Post a Comment