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?
How to insert a blank line by group* Example generated by -dataex-. For more info, type help dataex clear input str1 var1 float group "…
Generate variable (maybe needs a loop)I have the following data set: Parent Subsidiary Variable Value US UK revenue 10 US FRA revenue 15 …
Some questions about Correlation Random Effect ModelDear Statalisters: Thanks for reading it! I'm using a two-period panel data to figure out the impa…
Standardization of time in panel data with different treatmentsHi everybody I am working with panel data and investigating how employees experience the transfer f…
Mlabcolor, mlabsize, etc. not changing in scatter plot since Stata updateHello, I have been having a number of issues with my graphics in Stata (16, updated with every new …
Subscribe to:
Post Comments (Atom)
0 Response to substr existing variable label and replace existing varlabel?
Post a Comment