Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Charting / September 2005

Tip: Looking for answers? Try searching our database.

Perpendicular distance of a point from linear regression line?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Winny - 21 Sep 2005 12:21 GMT
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
Jon Peltier - 21 Sep 2005 13:01 GMT
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/
_______

> Hi all,
>
[quoted text clipped - 11 lines]
>
> --Winny
Winny - 21 Sep 2005 14:19 GMT
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
Tushar Mehta - 25 Sep 2005 00:06 GMT
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-LineDistance2-Dimensional.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)

Signature

Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

> You know slope and intercept of fitted line, and coordinates of point,
> so you can calculate dx and dy, the horizontal and vertical distance
[quoted text clipped - 26 lines]
> >
> > --Winny
Jon Peltier - 25 Sep 2005 00:29 GMT
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/
_______

> Hi Jon,
>
[quoted text clipped - 6 lines]
> It gives the distance of (x0,y0) from ax+by+c=0 as
> abs(a*x0+b*y0+c)/sqrt(a^2+b^2)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.