+ Reply to Thread
Results 1 to 5 of 5

Perpendicular distance of a point from linear regression line?

  1. #1
    Winny
    Guest

    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. #2
    Jon Peltier
    Guest

    Re: Perpendicular distance of a point from linear regression line?

    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. #3
    Winny
    Guest

    Re: Perpendicular distance of a point from linear regression line?

    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. #4
    Tushar Mehta
    Guest

    Re: Perpendicular distance of a point from linear regression line?

    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 <#[email protected]>,
    [email protected] 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. #5
    Jon Peltier
    Guest

    Re: Perpendicular distance of a point from linear regression line?

    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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1