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
matrix recursive elementHi, I want to run this code Code: local filas = 300 local columnas = 1 matrix A = J(`filas',`colum…
Two way pyramid graph using countries instead of rangeHello! I'm trying so hard to replicate a graph like this, it's some sort of a pyramid but it is not …
Referring to local macros using unabHello statalisters, I have 227 variables that are grouped by common prefixes. I am trying to use th…
Multiple McNemar TestHello all, I am doing 10 McNemar test for comparing matched data. Example: mcci 192 0 1 0 1. Just li…
Data manipulation - your experience with mergingHi I’m working with very large datasets - ones that contain for 1mill observations with 20+ variable…
Subscribe to:
Post Comments (Atom)
0 Response to Loops
Post a Comment