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
Tabout and Fre suddenly not working?For some reason when I export frequency tables to excel and/or word (as .csv or .rtf files), they ar…
Meta Command for prevalencesI'm trying to run a meta-analysis using the metan command for a rate of the progression outcome vari…
Find attrition at personal levelDear Stata users, I am using an unbalanced panel dataset. Here is an example of my dataset. hhid …
Break in consecutive values to identify groupsSuppose I have a dataset like this: clear set obs 20 gen x = 1 gen id = 1 in 1/10 replace id = …
Multilevel regresion code doubtHi all, I have date of 100 employees per company, for several companies. I would like to perform a …
Subscribe to:
Post Comments (Atom)
0 Response to renaming multi-variables using foreach
Post a Comment