my variables are named B, C, D, E,... EY (because i imported from excel), and they have labels such as 512BXIPI_BP6_USD.Q, 513BXIPI_BP6_USD.Q.....
I want to create a loop to convert the variable names to be y512, y513.. i wrote the following but it returns.."512BXIPI_BP6_USD: operator invalid"... help will be appreciated..
keep year B-EY
foreach v of varlist B-EY {
local x: variable label `v'
local nz = substr(`x', 1,3)
rename `v' y`nz'
}
Related Posts with Loop renaming from labels
Stata - statistical graphing using "coefplot" by presenting odd ratio with 95%CIDear colleagues, I wish this message find you well. I am wondering how to use "coefplot" by presenti…
Sequential Treatment EffectsHi, I have been struggling for a model to estimate related to sequential treatment effect and need …
Sorting the order of bar graph values while using byHello! I want to order the results of a bar graph in descending order. I have two facets/panels as …
Durbin Watson d-statisticHi, I am running a regression with multiple lagged variables of the dependent variable Code: reg CS…
Set https proxyHi Statalisters, I have some problems at importing data directly from internet. I am using Stata in…
Subscribe to:
Post Comments (Atom)
0 Response to Loop renaming from labels
Post a Comment