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?
estimation sample variesGood day, I get following error message Code: bys id: gen treatment=0 if (expectation==2 & f.…
How to test if the mean of a sample is significantly different from zeroHi everyone, I have a sample of 166 bonds (i.e. n=166). I have broken these down into subsamples ba…
Pairwise matching: first nearest neighbourHi, I'm new on Stata and I have some difficulties to realise a pairwise matching. Here is a simplifi…
Dropped year-dummies in panel regressionDear Statalisters, I have some issues understanding year-dummies being dropped in a fixed effects …
custom maximum likelihood estimators - best way to check for convergence?I've made a package to estimate a model by maximum likelihood. I'd like to store a result as e(conve…
Subscribe to:
Post Comments (Atom)
0 Response to substr existing variable label and replace existing varlabel?
Post a Comment