Hi,
I want to loop over 150 variables, which has the format like code_001, code_002, ....., code_150. I've tried:
foreach i in 001/150
or
forvalues i in code_001-code_150
or
foreach i in 001-150
However, none of them works.
Could you please help me to correct the syntax.
Thank you!
Related Posts with For loop in Stata
How to create Industry specialist variable based on SIC codeHi all, For my research, I need to know for every company (CIK) in my dataset whether this company …
Instrumental Variable approach with more than one endogenous binary variablesDear Stata users, This is my first post here and I hope I am doing it properly, according the forum…
Which level fixed effect I should choose?region or firm?or both?Dear all Now I proceed a research. The sample data I use is the financial indexes of listed firms, e…
reg3- Can the same exogenous variables appear more than once in the system?Hi all, I'm working on a 3SLS regression where I have three endogenous variables and a set of exoge…
Overlap weightingDear Statalists, I would like to use overlap weighting instead of conventional IPTW because baselin…
Subscribe to:
Post Comments (Atom)
0 Response to For loop in Stata
Post a Comment