BookmarkSubscribeRSS Feed
somebody
Lapis Lazuli | Level 10

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!

4 REPLIES 4
user24feb
Barite | Level 11

Use

proc reg data=input outest=prms; * outEST !;
somebody
Lapis Lazuli | Level 10

Thanks, I found out that OUTEST option right after posting the question. I have modified my question slightly.

user24feb
Barite | Level 11

Use "ODS Trace On/Off" to check the ODS output and use "ODS Output" to get FitStatistics & ParameterEstimates.

Rick_SAS
SAS Super FREQ

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"

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is ANOVA?

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.

Discussion stats
  • 4 replies
  • 1727 views
  • 0 likes
  • 3 in conversation