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)
Working with Stata datesHello, I would like to create a variable, called "outcome", measured as a dummy indicator equal to …
Help creating a bar graph over multiple variablesGreetings, When creating a graph bar and dividing it over a variable, I cant figure out a way to add…
Trouble working with %tc datesHello, I have a variable "EndDate" whose format is double yet displays as if it was %tc. I need to …
help with Synthetic controlhello everyone. Ive compiled data on a large amount of countries to perform synthetic control. yeste…
How to calculate Point Estimates in a regressionDear All; Need your kind help. I have a file tea_data.csv (attached for reference). I generated the…
Subscribe to:
Post Comments (Atom)
0 Response to rename variables with foreach (getting rid of prefix)
Post a Comment