I have a set of variables v1 through v154 that I want to relabel by excluding the first 16 characters of the original label. The following code expresses what I want to do, but it is not in proper syntax since you cannot use the substr() function in the label variable command.
foreach x of varlist v1-v154 {
local varlabel : var label `x'
label variable `x' substr("`varlabel'",17,.)
}
How do I achieve my task?
Related Posts with Renaming each variable label as a substring of old label
removing text from string variable with date formatHello, I have a string variable that looks like this: 13-03-2014(Late visited). How can I remove som…
Looping a regression command sequentially by observation and storing each model.Hi all, Apologies if this is very simple or has been asked before. I have searched through many top…
Confidence interval for graphsHi all, I am plotted a connected graph using this code: Code: twoway (connected weekmeanifference …
Importing csvHi, I have an easy problem, but unfortunately I could not solve it. When I want to import data fro…
Herfindahl-Hirschman Index for banksHello, I have a problem creating Herfindahl-Hirschman Index for my data I tried scc install hhi but…
Subscribe to:
Post Comments (Atom)
0 Response to Renaming each variable label as a substring of old label
Post a Comment