I have a set of variables v1 through v154 that I want to relabel by excluding the first 16 characters of the original label. The following code expresses what I want to do, but it is not in proper syntax since you cannot use the substr() function in the label variable command.
foreach x of varlist v1-v154 {
local varlabel : var label `x'
label variable `x' substr("`varlabel'",17,.)
}
How do I achieve my task?
Related Posts with Renaming each variable label as a substring of old label
Latent class analysis - constraining categorical variablesHi Statalist! I am trying to perform a latent class analysis and I am very new to this method, so I…
Testing significance for Alphas CAPMHello everybody, I have calculated monthly alphas and betas for monthly fund data from different po…
Comparing independent variables in different models with the samen depedent variableHello, I am running three multiple linear regression models. In all three, the dependent variable i…
An issue using esttab syntaxHello, I would like to show the `y' variable in excel when running each of the following regressions…
How to rename and format variables from appended tempfile?Hi Statalist, I'm trying to append, rename, format and generate new variables. may goals are to; 1.…
Subscribe to:
Post Comments (Atom)
0 Response to Renaming each variable label as a substring of old label
Post a Comment