I'm not sure how to phrase this question but I want to use all the existing variable labels but add the same additional information at the end of all the variable labels from the same dataset. For example it would be something like
variable1 "Variable 1"
variable2 "Variable 2"
to
variable1 "Variable 1 residential"
variable2 "Variable 2 residential"
The farthest I have gotten is using a foreach loop to use the variable name and add the same label extension to all the variables but not the original variable labels
This is a sample of code for how far I've gotten
clear
sysuse auto.dta
foreach x of varlist _all {
local label: variable label `x'
label var `x' "`x' Residential"
}
Any help for how to get the original variable labels with the "Residential" added would be appreciated.
Related Posts with Add same extension to existing variable labels
Beta regression problemHi, I am using panel data for 27 different countries in 5 different time periods. My IV and DV both …
Postfile command gives error/notification ''File not found''Dear all, I ran the following code in Stata: Code: clear all set seed 312312 set obs 100 gen t = _…
Multicollinearity issues with Industry- and year-dummiesDear all, I am running a panel regression with random effects. I use industry- and time- dummies to …
How to put frequency, mean and other specific values into WORD and EXCELHi there, I am currently dealing with descriptive analysis. In my dataset, there are many categoric…
Making graphs of variablesHello, I want to make two graphs in Stata but I don't know how to do that. I have the following dat…
Subscribe to:
Post Comments (Atom)
0 Response to Add same extension to existing variable labels
Post a Comment