Learning SAS? Welcome to the exclusive online community for all SAS learners.

PROC REG Output

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 5
Accepted Solution

PROC REG Output

Hello,


I am using PROC REG to get the intercept, betas and residuals for a two variable regressions that needs to be grouped by time period.  I would like to just have the program output me some sort of table that just gives the regression values for each time period (my BY group).  I am using the following code:


proc reg data = mylib.reg1 noprint;
      model score = mktcap VOL1M;
      by MONTH;
      output out = mylib.reg2
      predicted = mktcapbeta volbeta
      residual = mktcapres volres;
run;

This is obviously returning me the wrong answers because I don't want the predicted values and the residual values for each observation.  I want the overall model betas and intercepts.  What do I use in the output statement to get those correct values?  I have a lot of months to analyze, so I don't want the output to just print a whole bunch of plots that I have to sift through to get the betas and such.

Thanks,

John


Accepted Solutions
Solution
‎06-16-2014 05:54 PM
Trusted Advisor
Posts: 1,228

Re: PROC REG Output

proc reg data = mylib.reg1 noprint outest=estimates;

      model score = mktcap VOL1M;

      by MONTH;

proc print data=estimates;

run;

View solution in original post


All Replies
Super User
Posts: 19,789

Re: PROC REG Output

You can capture the parameter estimates with the ODS Table statement.

Additionally you can control what output gets generated using ODS SELECT, for example if you want only the parameter Estimates printed the following would work.

ods table parameterEstimates=MyEstimates;

ods select parameterEstimates;

proc reg data = mylib.reg1 noprint;

      model score = mktcap VOL1M;

      by MONTH;

run;

Solution
‎06-16-2014 05:54 PM
Trusted Advisor
Posts: 1,228

Re: PROC REG Output

proc reg data = mylib.reg1 noprint outest=estimates;

      model score = mktcap VOL1M;

      by MONTH;

proc print data=estimates;

run;

Occasional Contributor
Posts: 5

Re: PROC REG Output

Thank you so much!  This is exactly what I wanted!

John

Occasional Contributor
Posts: 5

Re: PROC REG Output

One more thing, if you can, is there a way to get the t-stat as a simple output per model as we just got for the betas and the intercepts?

Thanks,

John

Trusted Advisor
Posts: 1,228

Re: PROC REG Output

Try this for t-stat and 95% CI.

proc reg data = mylib.reg1 noprint outest=estimates tableout alpha=0.95;;

      model score = mktcap VOL1M;

      by MONTH;

proc print data=estimates;

run;

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 1071 views
  • 1 like
  • 3 in conversation