I am trying to convert some long lists of values in Excel and I basically need to create a long list of foreach and forvalues loops which I will then transfer to STATA to execute. When I try to program a loop in one single line, I keep getting 'program error: code follows on the same line as open brace'. Is there a delimiter I could put in the code so I can keep it in one line. This is the code I am trying to use. Sorry but I am a bit rusty in my STATA.
foreach i = "C30.0", "C31" {forvalues j = 8004, 8032, 8050(1)8076, 8078, 8083(1)8084, 8123, 8560, 8980 {display `i';",";`j' } }
Thanks again
Neville
Related Posts with forvalues or foreach loop in one line of code
Outliers in logistic regressionDear forum, I am having trouble with identifying outliers using the post estimation-command in a lo…
how to do propensity score matchinghi everyone I m trying to do psm test but i do not what the wrong is this command correct or not? …
GDP on Gravity ModelI really need help on my panel regression. My dependent variable is bilateral trade flow. My Indepen…
Tabulate the averages of multiple variables (two-way)Hi, With the following data: Code: * Example generated by -dataex-. To install: ssc install data…
Correlation matrix of the VAR model standard errorsDear Stata users, I am wondering how I can get the correlation matrix of my VAR model standard error…
Subscribe to:
Post Comments (Atom)
0 Response to forvalues or foreach loop in one line of code
Post a Comment