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
Rdplot confidence interval not showingHi all, I have the following code: rdplot aux1hm aux1dm if agech >= `agelow' & agech <= `…
sum of the coming 5 years of a variableDear Statalist, I am trying to generate a variable, that is equal to the sum of the coming 5 years …
Twoway Line Chart for Regression Dummy CoefficientsDear all, Suppose I have a large dataset that comprises the age and income of Individuals. Now assu…
interpolate between two year dates using expandHi all, For my panel data, I want to linearly interpolate between two years. I have data for the pe…
Random sample panel datahello guys! My data consist of unbalanced Panel data with the identifier gvkey_num fyear, fyear con…
Subscribe to:
Post Comments (Atom)
0 Response to Renaming each variable label as a substring of old label
Post a Comment