0

I have a dataset consisting of x and y, both are relative numbers. I want to iterate over the slope within a certain interval (let's say n = 3) and retrieve the model parameters, r- and p-value in a list. So I basically want to find the slope within a given set of points, move further down the x-axis and repeat this, over and over.

Eventually, I can find out at what point the slope is no longer significant and then the corresponding x-value. Underneath is an illustration of my idea. Red indicates significant slopes, blue indicates insignificant slopes as it moves further on the x-axis.

Illustration of iterative slope (I cannot yet upload photos here).

Thomas
  • 441
  • 3
  • 16
  • Can you clarify what you're trying to accomplish? See: http://xyproblem.info/ – Dave Apr 30 '20 at 14:26
  • @Dave, yes I can, thank you. As I mentioned, I would like to find the point (x-value) in which the slope is no longer significant. – Thomas Apr 30 '20 at 14:41
  • this question is then a duplicate of this one: https://stackoverflow.com/questions/29382903/how-to-apply-piecewise-linear-fit-in-python – Dave Apr 30 '20 at 15:01
  • Then I say thank you, once again! – Thomas Apr 30 '20 at 15:05

0 Answers0