Hi everybody,
I'm trying to replace an existing variable label with a subtract of the existing varlabel (first nine characters) within a Stata loop:
my code looks like this:
foreach var of varlist _all {
local varlabel: var label `var'
local newname: substr(`varlabel',1,9)
label `var' `newname'
}
Then I receive the following error:
substr not allowed ??
Hope you can help
Kind regards Frank
Related Posts with substr existing variable label and replace existing varlabel?
Interactions with dummiesDear all, In the following interaction, how can I specify if female==1 (for women)? I want to look …
Collapse vs dropI am trying to collapse this data of all treatment lines to include only the first treatments for th…
Finding lags in panel dataDear members, I would like to know if there is a Stata program to help me find the most appropriate…
Creating a treatment and control variable and making a Twoway Line Plot of Parallel TrendsHi all, I have run into a bit of an issue. I am attempting to make a parallel trend twoway line plo…
Dropping observationsHello Members, I have a dataset that looks like this: Code: clear input float(time v1 v2) 1 500 …
Subscribe to:
Post Comments (Atom)
0 Response to substr existing variable label and replace existing varlabel?
Post a Comment