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
Time Fixed Effect without having a dummy variable possible?Hi everyone, I am not sure if this is a specific Stata question, if not I am sorry. I am working o…
Calculating percentagesHello, I am trying to graph the percentage of child brides by country subdivisions. Every area (GOV…
line of strings to reduce programming stepsHello and good day Statalist! I'm trying to figure out a command way to save myself some steps in a…
Summary Statistics for panel data yearlyHello. I have panel data for Chinese banks from 2000 to 2019. I want to check the averages of total …
variables generate with expand are not unique to duplicated observationsHello everyone, I'm working on my thesis using Stata 16, I've been using it a bit in the past but I…
Subscribe to:
Post Comments (Atom)
0 Response to Renaming each variable label as a substring of old label
Post a Comment