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
Choosing a control condition in Interrupted time seriesDear colleagues how can I choose the best control condition in Interrupted time-series among the pos…
Specifying the linear predictor for random intercept model on panel data.Dear Stata Community, I am running a random intercept model on a longitudinal dataset where I am in…
Error of sample contain multiple panels: Panel data with multiple identifiersI am attempting to obtain the autocorrelations and partial autocorrelations and to perform the Dicke…
date conversionA bit new to Stata. Wondered if someone could tell me how to convert a date variable from an externa…
trade structural gravity equation; instruments; ppmlhdfeI work with trade data: 75 importers, 75 exporters; 2004-2018 period, six-digit HS Industries (5219)…
Subscribe to:
Post Comments (Atom)
0 Response to Renaming each variable label as a substring of old label
Post a Comment