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 repeat some command linesHello all, I need to repeat 3 line of commands in stata to create updated observations for three va…
cannot compute an improvement -- discontinuous region encounteredI am trying to build a multilevel model with the governrate-level indicators, but I get this problem…
Tobin's QHi all, I am trying to merge two data sets from Compustat to get Tobin's Q. I try to merge the two …
How to loop element-by-element operations (e.g regression)Hello, I am trying to find a way to loop element by element operations across two lists of variables…
reshape / transpose large dataset for mergingI am constructing a large timeseries dataset, with cases arranged around WDI_code (World Development…
Subscribe to:
Post Comments (Atom)
0 Response to substr existing variable label and replace existing varlabel?
Post a Comment