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
Robust option in a ols modelHi everyone, I was wondering if one can use robust option in a ols regression model that includes bo…
How to deal with error correlation model with Stataregression function is : Array Array In the following data, variable value is the value of 1952,…
How to extract one variable from a string?We have a dataset of different movies but genres contain more than one variable. For example, under …
How do I create a constant sample of firmsHi, I would need some help with the following problem please, I'm a new STATA user: I have a list o…
Store tab command's resultsHi all! I created a variable indicating in which income decile individuals of a population are. I t…
Subscribe to:
Post Comments (Atom)
0 Response to Loops
Post a Comment