Hi, I need help getting something similar to this:
Here's a tiny bit of my data:
Year | Month | Day | Hour | Load | Temperature |
2009 | 1 | 1 | 0 | 70232 | 20.87 |
2009 | 1 | 1 | 1 | 68422 | 20.61 |
2009 | 1 | 1 | 2 | 67014 | 20.27 |
2009 | 1 | 1 | 3 | 66068 | 20.52 |
2009 | 1 | 1 | 4 | 65781 | 21.45 |
2009 | 1 | 1 | 5 | 66308 | 21.69 |
2009 | 1 | 1 | 6 | 67559 | 21.87 |
2009 | 1 | 1 | 7 | 69150 | 22.39 |
Y = Load , X = Temp
You can't have a correlation or slope with only a single or even two observations, so it's a moving statistics of some kind. You need to define the window.
Depending on the window and exact calculations I'd probably recommend either an array approach or PROC EXPAND.
Here's the PROC EXPAND documentation:
Available transformations:
Otherwise, an array.
http://support.sas.com/kb/25/027.html
You'll likely need to write the formula for the slope/intercept either way, by determining the formulas/components and doing the calculation.
What are your definitions of slope and correlation here?
Do you have SAS/ETS licenced?
You can check with:
proc product_status;run;
@matt23 wrote:
Hi, I need help getting something similar to this:
Here's a tiny bit of my data:
Year Month Day Hour Load Temperature 2009 1 1 0 70232 20.87 2009 1 1 1 68422 20.61 2009 1 1 2 67014 20.27 2009 1 1 3 66068 20.52 2009 1 1 4 65781 21.45 2009 1 1 5 66308 21.69 2009 1 1 6 67559 21.87 2009 1 1 7 69150 22.39 Y = Load , X = Temp
Actually working on 9.4 version right now
im not sure it makes any sense. why is slope not negative in the 20s where it's dipping down? correlation=autocorrelation?
@pau13rown The graph is of slope over time, so the first image which is based off the second table below I assume.
@matt23 What are your definitions of slope and correlation? SAS is packaged by modules, so 9.4 does not tell me if you have SAS /ETS or specifically if you can use PROC EXPAND which is used to calculate moving statistics easily.
oh ok, load "sensibility"
proc product_status;run
For SAS/ETS ...
Custom version information: 14.2
Sorry, I don't know what it means
Still need to know how you're defining slope and correlation here.
@matt23 wrote:
proc product_status;run
For SAS/ETS ...
Custom version information: 14.2
Sorry, I don't know what it means
Load = Intercept + Slope * Temperature
So I believe the slope is from regression at a specific time if I am not mistaken
Correlation is a correlation between load and temperature at time
I don't know if it makes sense
You can't have a correlation or slope with only a single or even two observations, so it's a moving statistics of some kind. You need to define the window.
Depending on the window and exact calculations I'd probably recommend either an array approach or PROC EXPAND.
Here's the PROC EXPAND documentation:
Available transformations:
Otherwise, an array.
http://support.sas.com/kb/25/027.html
You'll likely need to write the formula for the slope/intercept either way, by determining the formulas/components and doing the calculation.
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.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.