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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 1413 views
  • 0 likes
  • 3 in conversation