Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Winny
 
Posts: n/a
Default 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   Report Post  
Jon Peltier
 
Posts: n/a
Default

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   Report Post  
Winny
 
Posts: n/a
Default

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

  #4   Report Post  
Tushar Mehta
 
Posts: n/a
Default

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)

--
Regards,

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

In article ,
says...
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


  #5   Report Post  
Jon Peltier
 
Posts: n/a
Default

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
count distance in column bill gras Excel Worksheet Functions 4 August 1st 05 07:42 AM


All times are GMT +1. The time now is 11:44 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"