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
missing valuesHello, I wanted to create a dummy based on a certain variable, but only if that variable had a value…
Row selection in two words namesHi all, I am trying to solve a problem in name selection (row selection) for a specific condition (…
Propensity Score Matching and Interaction TermsHi all! I am currenlty analyzing a cross section dataset with propensity score matching and got the…
Graph CombineI would like to combine about 200 graphs in one pdf so that each graph is displayed below each other…
xtgee with IPWHi. I am looking at the effect of non-employer based health insurance on self-employment on panel da…
Subscribe to:
Post Comments (Atom)
0 Response to Loops
Post a Comment