- #1
paqqj
- 8
- 0
inverse best fit slope...expected vs calculated
Given a set of data (X,Y) pairs, we can get the best fit line using many techniques. Assume the correlation is not perfect. We can use the least squares method to get the best fit line slope and intercept. So we have Y = mX + b
In other words, given some X, we can determine the most likely value of Y.
However, I am confused with this next step.
Wouldn't the inverse also hold true? In other words, given some Y, shouldn't I be able to calculate the most likely X based on rearranging the formula Y = mX + b into
X = Y/m - b/m ?
But why is it that if I plot my original data on opposite axes, so that the X is on the Yaxis and vice versa, and I calculate the best fit slope and intercept on this data, I don't get the expected slope of 1/m nor the expected intercept of -b/m ?
I will cheat a little here and just post the answers I got using Excel to show you the difference.
The three data points (1,3) (2,5) and (3,12) result in m=4.5 and b= -2.3333333
Y = 4.5 X - 2.33333333
Rearrange that to get X = 0.22222222 Y + 0.5185185
However, if the original points are interchanged into (3,1) (5,2) and (12,3)
using Excel or other least squares techniques yields m=0.2014925 and b=0.656716
Shouldn't the expected slope be the same as the calculated one?P.S. The other data set I'm working with has 2,000 points, and the expected slope is 1.71 while the calculated slope is 0.96. Definitely not the 1/m I was expecting!
Given a set of data (X,Y) pairs, we can get the best fit line using many techniques. Assume the correlation is not perfect. We can use the least squares method to get the best fit line slope and intercept. So we have Y = mX + b
In other words, given some X, we can determine the most likely value of Y.
However, I am confused with this next step.
Wouldn't the inverse also hold true? In other words, given some Y, shouldn't I be able to calculate the most likely X based on rearranging the formula Y = mX + b into
X = Y/m - b/m ?
But why is it that if I plot my original data on opposite axes, so that the X is on the Yaxis and vice versa, and I calculate the best fit slope and intercept on this data, I don't get the expected slope of 1/m nor the expected intercept of -b/m ?
I will cheat a little here and just post the answers I got using Excel to show you the difference.
The three data points (1,3) (2,5) and (3,12) result in m=4.5 and b= -2.3333333
Y = 4.5 X - 2.33333333
Rearrange that to get X = 0.22222222 Y + 0.5185185
However, if the original points are interchanged into (3,1) (5,2) and (12,3)
using Excel or other least squares techniques yields m=0.2014925 and b=0.656716
Shouldn't the expected slope be the same as the calculated one?P.S. The other data set I'm working with has 2,000 points, and the expected slope is 1.71 while the calculated slope is 0.96. Definitely not the 1/m I was expecting!
Last edited: