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?
0 Response to Renaming each variable label as a substring of old label
Post a Comment