I want to run PROC REG hourly like in the code below:
proc sort data=matt (where=(Month in(6,7,8))); by Month Hour; run; proc reg data=matt (where=(Month in(6,7,8))); model Load=Temperature; by Hour; label Load="Load (MW)" Temperature="Temperature (degrees F)"; title 'Load vs Temperature (Summer)'; run;
Now, is there a way I can get out a new data out of this that records just the intercept value for every hour. Like this:
input hour intercept;
datalines;
0 1234
1 1333
2 1400
...;
"ods output parameterestimates=getintercept;" https://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_reg_sect051...
if that doesn't work let me know
Sorry, I am not a pro at SAS, Do you have an example of a code that uses this to give me an idea how to implement this?
there was a recent post that covered ods in general: https://communities.sas.com/t5/Base-SAS-Programming/Extracting-variables-from-statistical-results-fo...
for your particular code it would be:
ods output parameterestimates=get_intercept (where=(parameter=''));
proc reg data=matt (where=(Month in(6,7,8)));
model Load=Temperature;
by Hour;
label Load="Load (MW)" Temperature="Temperature (degrees F)";
title 'Load vs Temperature (Summer)';
run;
i'm not sure about this bit: (where=(parameter='')) because i'm not sure what the variable name will be and what the text will be, maybe you want parameter='Intercept', but you'll have to look at the dataset created (called get_intercept) to see what it contains and to confirm that you have the intercept estimate for each hour
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.