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 ............. ..........
Thanks!
Use
proc reg data=input outest=prms; * outEST !;
Thanks, I found out that OUTEST option right after posting the question. I have modified my question slightly.
Use "ODS Trace On/Off" to check the ODS output and use "ODS Output" to get FitStatistics & ParameterEstimates.
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"
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.