Hi,
I have the following code :
egen identifier = group(isin)
sum identifier
scalar max2=r(max)
local k = max2
gen ocft=.
gen ocft1=.
forvalues i=1(1)`k' {
qui regress RETURN OCFt OCFt1 if identifier == `i'
qui replace ocft=_b[OCFt] if identifier == `i'
qui replace ocft1=_b[OCFt1] if identifier == `i'
di `i' " / " `k'
}
Stata says invalid syntax if I execute the loop. I do not find the mistake. Can you help me please?
Related Posts with Loops
Heckman sample selection & ivregI'm trying to estimate the union wage premium. There are two potential issues I need to tackle: 1. …
Calculating proportions of several categoriesHello dear all, I am facing a serious problem to use the command proportion. I have a series of neig…
Same coefficients in Ologit and Gologit2 modelsHello, I am new to ordered logit regression and tried my data with both ologit (failed brant) and g…
Forecasting with predict command not workingHey all, I'm trying to predict future numbers based on an ARIMA model but when I predict using the …
Executing multiple do files with data in another directoryHi, I'm looking to redesign my STATA do file processing to be more scalable. I have one main.do file…
Subscribe to:
Post Comments (Atom)
0 Response to Loops
Post a Comment