Stata - regress and estimates store using forvalues

I've tried to repeat the following process:

forvalues i=1990(1)2013 { 
reg a b c if year==`i',r
est sto G`i'
}

However, Stata regress and doesn't store the coefficients of each regression. Probably, forvalues isn't the best command to do that, but I don't know which coding is better.

Upvotes: 0

Views: 729

Answers (1)

ℕʘʘḆḽḘ
ℕʘʘḆḽḘ

Reputation: 19375

as Nick suggested, here the very obvious solution is

ssc install esttab

forvalues i=1990(1)2013 { 
    reg a b c if year==`i', r
    eststo G`i'
}

esttab, ar2

Upvotes: 1

Related Questions