turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- BI
- /
- Enterprise Guide
- /
- Slope / Sensitivity / Correlation

Topic Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

06-26-2018 12:12 PM

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

Accepted Solutions

Solution

06-26-2018
03:31 PM

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to matt23

06-26-2018 03:15 PM

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.

All Replies

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to matt23

06-26-2018 12:13 PM - edited 06-26-2018 12:14 PM

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

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Reeza

06-26-2018 12:18 PM

Actually working on 9.4 version right now

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to matt23

06-26-2018 12:24 PM

im not sure it makes any sense. why is slope not negative in the 20s where it's dipping down? correlation=autocorrelation?

--------------

blog: papersandprograms.com

blog: papersandprograms.com

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to PaulBrownPhD

06-26-2018 12:26 PM - edited 06-26-2018 12:27 PM

@PaulBrownPhD 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.

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Reeza

06-26-2018 12:34 PM

oh ok, load "sensibility"

--------------

blog: papersandprograms.com

blog: papersandprograms.com

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Reeza

06-26-2018 01:30 PM

`proc product_status;run`

For SAS/ETS ...

Custom version information: 14.2

Sorry, I don't know what it means

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to matt23

06-26-2018 01:41 PM

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

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Reeza

06-26-2018 01:46 PM

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

Solution

06-26-2018
03:31 PM

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to matt23

06-26-2018 03:15 PM

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.