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?