Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Perpendicular distance of a point from linear regression line?
Hi all,
First post for me on here. I have some Excel charts, with least squares fit lines through the data. On each chart I have a single extra data point (it's own series) and I want to know the perpendicular distance from the line to this point. This is a physical distance in the real world, as my axes are both in milimeters but to different scales. Thanks for any help. --Winny |
#2
|
|||
|
|||
You know slope and intercept of fitted line, and coordinates of point,
so you can calculate dx and dy, the horizontal and vertical distance from point to line. By similar triangles, the shortest distance h from line to point is: h = dx dy / SQRT[(dx)^2 + (dy)^2] - Jon ------- Jon Peltier, Microsoft Excel MVP Peltier Technical Services Tutorials and Custom Solutions http://PeltierTech.com/ _______ Winny wrote: Hi all, First post for me on here. I have some Excel charts, with least squares fit lines through the data. On each chart I have a single extra data point (it's own series) and I want to know the perpendicular distance from the line to this point. This is a physical distance in the real world, as my axes are both in milimeters but to different scales. Thanks for any help. --Winny |
#3
|
|||
|
|||
Hi Jon,
Thanks very much. I should have been able to work that out for myself really, but the trig part of my brain has been unused for a couple of decades. --Winny |
#5
|
|||
|
|||
He he, I used a much less advanced technique than you did.
- Jon ------- Jon Peltier, Microsoft Excel MVP Peltier Technical Services Tutorials and Custom Solutions http://PeltierTech.com/ _______ Tushar Mehta wrote: Hi Jon, I cannot derive the formula you got but it cannot work for any vertical or horizontal line. For an approach from MathWorld see http://mathworld.wolfram.com/Point-L...mensional.html It gives the distance of (x0,y0) from ax+by+c=0 as abs(a*x0+b*y0+c)/sqrt(a^2+b^2) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
count distance in column | Excel Worksheet Functions |