Desktop productivity for business analysts and programmers

Slope output for multiple PROC REG

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 89
Accepted Solution

Slope output for multiple PROC REG

If I run this code:

proc sort data=dataname;
where Month in (1,2,3);
where also Day in (1,2,3);
by Hour;
run;

proc reg data=dataname;
where Month in (1,2,3);
where also Day in (1,2,3);
model Y=X;
by Hour;
run;

And I get Regression results for every hour.

Is there a way I can output slope of X for every hour into a new table or whatever? Anything just so I don't have to manually copy the slope (Parameter Estimates) into notepad?


Accepted Solutions
Solution
‎07-02-2018 02:43 PM
Respected Advisor
Posts: 3,294

Re: Slope output for multiple PROC REG


All Replies
Solution
‎07-02-2018 02:43 PM
Respected Advisor
Posts: 3,294

Re: Slope output for multiple PROC REG

Super User
Posts: 24,028

Re: Slope output for multiple PROC REG

ods output ParameterEstimates=PE_Table;
proc reg data=dataname; where Month in (1,2,3) and Day in (1,2,3);
by Hour; model Y=X; run;

 

Another method is using the ODS OUTPUT statement, this approach allows you to capture almost any ODS output and then reformat into the output you'd like. 

https://blogs.sas.com/content/iml/2017/01/09/ods-output-any-statistic.html

☑ This topic is solved.

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

Discussion stats
  • 2 replies
  • 100 views
  • 0 likes
  • 3 in conversation