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?
count *same names*in other groups?Dear All, I find this question here. The data is Code: * Example generated by -dataex-. To install…
Correlation categorical and continuous variableHi everyone and happy new Year, I would like to show in a plot that a categorical variable (a dummy…
robust standard error for IV panel regressionHi I have been running panel data random effect 2sls (G2SLS) and i want to robust to heteroskedastic…
Creating a new continuous variableHi everybody, Could anyone help me out with creating a new continuous variable? My main dataset do…
Addition by SICHi, Can you please help with the below. I need to add values by SIC code in the below example. (sim…
Subscribe to:
Post Comments (Atom)
0 Response to substr existing variable label and replace existing varlabel?
Post a Comment