Hi,
I am asking this clarification after going through STATA doc and some of the web content. Although I could not get the "foreach" for "rename" completely (I am still learning that command to understand more), I felt that the examples given in the doc and web have not helped me. Hence, I am posting here my question is that I would like to run rename command for many variables in one go. For eg. the existing variables b13_q2, b13_q3, and b13_q4 have to berenamed as b13q2, b13q3, and b13q4. I do have to do this for many variables. How I was doing was in MS-excel. But I wanted to do that in STATA. I wanted to know whether "foreach" would work or is there any other command is to be called? Could someone help me outfrom this.
Related Posts with renaming multi-variables using foreach
Correlation between dummy and continuous variablesHello everyone, I have panel data with countries and daily data on covid-19 outcomes at the country…
Replacing missing values with median (PANEL DATA)Hi, Statalist. I'm working on panel dataset where I want to replace the missing values in my column…
ARDL Co-Integration ApproachDear friends and colleagues, First of all, I would like to say that I'm new to this forum, so apolog…
Weighting in Stata when weight variable accounts for both sample-based and population-based corrections?Hello, I am using National Survey Data (specifically, UK LCF) for Regression Analysis that contains…
Expand each observation based on age in monthsDear Stata Users, I am dealing with a DHS data set. Here is what it looks like: ID number Age In…
Subscribe to:
Post Comments (Atom)
0 Response to renaming multi-variables using foreach
Post a Comment