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
Loop for excel file import and Kruskal –Wallis testDear User, I am trying to import several excel files and perform Kruskal –Wallis test test. Therefor…
elasticity- price, income etc. do i use a log-log model or employ mfx-eyex?Hi, I am very new to Stata so I apologise for the amateur-ness of my question. How do I calculate pr…
teffects - predict pscore, psI estimated the following model before estimating. I need to check the predicted propensity score mo…
Assign a label of a variable to a different variable Code: gen x = 1 label var x "this is x" gen y = 2 label var y "this is x" // <- how to automat…
Probit regression coefficientsDear all, I have conducted a double-bounded contingent valuation study and analysed it in Stata with…
Subscribe to:
Post Comments (Atom)
0 Response to renaming multi-variables using foreach
Post a Comment