07-10-2017 05:27 AM - edited 07-10-2017 05:45 AM
I am running regression based on year i.e. each year would have a different set of coefficients. I would like to obtain a dataset that contains all coefficients per year as well as other stats such as Standard Error, T-value, R-squared etc. My regression code is :
proc reg data=input; by year; model Y=X1 X2 X3; run;
My desired output is:
year alpha beta1 beta2 beta3 R-Squared t-stat_beta1 t-stat_beta2 2000 aaaa xxx yyy zzz rrrr tttttt ttttttt 2001 aaaa xxx yyy zzz rrrr ttttt tttttt 2002 aaaa xxx yyy zzz rrrr ttttt ttttttt 2003 aaaa xxx yyy zzz rrrr ttttt tttttt ............. ..........
07-10-2017 07:36 AM
See the article "ODS OUTPUT: Store any statistic created by any SAS procedure". The article has an example with PROC REG. The article uses the FitStatistics table, but you can substitute the ParameterEstimates table.
To find out the names of ODS tables, see the article "Find the ODS table names produced by any SAS procedure"