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
Out of sample prediction with the RMSE - panel dataDear all, I would like to run a panel regression for a subset of the time period of my dataset and …
Poisson with Robust SE showing totally different results from Log-OLS and NBHi, This is the first time I post question here. I've read pretty much all the posts on Poisson reg…
Xtabond2 lagged endogenous variableHi there, I am estimating the relationship between growth and inequality using dynamic panel data. …
reghdfe dkraayI am having trouble with the syntax for reghdfe. I would like to run a regression using reghdfe that…
Ranking/categorizing firms based on the value of a variable in a specific yearHi I am working with a panel data set with c300 firms from years 2008 to 2014, with several firm-le…
Subscribe to:
Post Comments (Atom)
0 Response to forvalues or foreach loop in one line of code
Post a Comment