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
Melogit model specificationHi everybody, I am currently working on the last phase of my thesis and I struggle with the last pa…
How to postfile glm output in IRR (relative risk)Dear all, I'd like to display glm model outputs using the postfile commend in stata (then transfer …
Problem with loop and outregHello everyone, I'm having trouble with a loop when trying to use the command outreg2 to extract th…
Help needed with melogitHi everybody, I am currently working on the last phase of my thesis and I struggle with the last pa…
why I can import complete data?Hello teachers please see the picture, why can't I import complete data? The "import first row as va…
Subscribe to:
Post Comments (Atom)
0 Response to Loops
Post a Comment