Dear all,

I am trying to generate a table of R-squared from multiple regressions.

Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input float(wageratio rel_lab_supply min_wage unemp_rate y ysqr ycube y1971 y1972 y1973 y1974 y1975 y1976 y1977 y1978 y1979 y1980)
.4664888 .33208805 1.6 3.525  9  .81  .729 0 0 0 0 0 0 0 0 0 0
.4549065  .3434718 1.6 3.075 10    1     1 1 0 0 0 0 0 0 0 0 0
.4576788 .35456455 1.6 2.525 11 1.21 1.331 2 1 0 0 0 0 0 0 0 0
.4374247  .3688146   2 3.075 12 1.44 1.728 3 2 1 0 0 0 0 0 0 0
.4299011  .3895005 2.1   5.7 13 1.69 2.197 4 3 2 1 0 0 0 0 0 0
end


I want to generate a table of R-squared corresponding to each variable in y* these regressions using loop or possibly generate a new variable with r-squared values for each year.

reg wageratio re_lab_supply y y* (for each y* = y1971 to y1980 - 10 regressions total)

For instance, I want to generate
1971 - rsq1
1972 -rqs2....and so on.

or a new variable rsquared with values - rsq 1971, rsq 1972 and so on.

How to do it?

Thanks in advance!