Hi All,


I have data that resembles the following:


Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input float(y x year)
 23   1 1999
123   2 1999
123 123 1999
  2 123 1999
123 123 2000
123  23 2000
123 123 2000
  2   3 2000
 21  12 2000
end

In the above, I perform regressions of y on x year-on-year, and wish to save the point estimates as well as the F-statistic. At present, I use the following code:

Code:
gen IV=.
g F=.
levelsof year, local(year)
foreach i of local year {
regress y x  if year == `i'  
gen temp2=_b[x]
replace IV=temp2 if  year == `i'
g temp3=r(F)
replace F=temp4 if year==`i'
drop temp2
drop temp3
}
Although the coefficient vector is generated appropriately, I get a blank vector for the F-statistics. Any help on this is much appreciated.

Best,
CS