ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Regions of Constant Slope (https://www.excelbanter.com/excel-discussion-misc-queries/265080-regions-constant-slope.html)

Lex

Regions of Constant Slope
 
I have a set of data x, y and want to find regions (or ranges) of "constant"
slope and I want the value of the slope and range x of that "constant" slope.
I'm not exactly sure what I mean by "constant" (note the quotes) but believe
I *may* be able to use RSQ (R-Squared) to define it.

I *believe* I may have to do it in VBA as I want to automate it - but again
- I'm not sure.

Your help is greatly appreciated.

Thank you!


Tom-S[_2_]

Regions of Constant Slope
 
The slope between data points can be defined by:

slope = (y2 - y1) / (x2 - x1)

So say your x data is in column A (say A2:A11) and y data in column B (say
B2:B11), the slope between the first 2 points can be defined by a formula in
C3:

=(B3-B2)/(A3-A2)

If you drag fill this formula down to C11, it will give you the slope
between successive pairs of data. Any 2 (or more) successive slope values
that are equal define a region of constant slope. (Since any 2 x.y points can
be joined by a straight line - or constant slope - then you really need at
least 3 x,y points which are joined by the same straight line to define a
'region' of constant slope.)

You can graph the data, using a line graph, to get a quick visual
confirmation of these regions.

Regards,

Tom


"Lex" wrote:

I have a set of data x, y and want to find regions (or ranges) of "constant"
slope and I want the value of the slope and range x of that "constant" slope.
I'm not exactly sure what I mean by "constant" (note the quotes) but believe
I *may* be able to use RSQ (R-Squared) to define it.

I *believe* I may have to do it in VBA as I want to automate it - but again
- I'm not sure.

Your help is greatly appreciated.

Thank you!



All times are GMT +1. The time now is 09:51 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com