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)
Wrong parentheses for graph codeHi everyone, I intent to add my calculated confidence intervals to my graph: This is the code for …
Help understanding behavior of space in graph codeHello... I had a student run into a problem creating a graph when trying to apply a scheme...it wou…
Heckman two-step can not cluster standard errorsDear Statalists, My dependent variable is y2_ft in the second stage of heckman selection model, f d…
stset with condition | Issue with codeWhat is wrong with my stset? I am excluding duplicates with the dupdrops variable for outcome analys…
stset survival analysis error message: variable _d already definedHi StataList, I'm trying to use the stset command for survival analysis: Code: stset failure1_day…
Subscribe to:
Post Comments (Atom)
0 Response to rename variables with foreach (getting rid of prefix)
Post a Comment