I am working with a dataset of stock prices that has 505 variables (firms) with 1.578 observations (days) each. Each variable is currently labeled like e.g. "AMAZON.COM - TOT RETURN IND", "ALPHABET A - TOT RETURN IND", etc.
My question is whether it is possible to generate a separate list (e.g. in Excel or as a .txt-File) which contains the name of each firm in the way I would like to have it displayed, e.g. "Amazon Alphabet ...".
I would then like to use this name in conjunction with rename and label, e.g.
Code:
foreach var of varlist var1 - var505 { rename `var' return_NAMELIST label `var' "Return NAMELIST" }
I hope I was able to explain my query in an understandable way.
Thank you for your help in advance.
Kind regards,
Peter
0 Response to Rename variables based on a separate list of names
Post a Comment