1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Errors of the slope and intercept of a regression line

  1. Jan 29, 2015 #1
    I have set of date with error bars of different length on my y values. I want to know what the error is on the slope and intercept of my line of best fit through this data. Is there a numerical way to calculate this that takes into account the fit of the regression line and the y error bars?
     
  2. jcsd
  3. Jan 29, 2015 #2

    Quantum Defect

    User Avatar
    Homework Helper
    Gold Member

    See: http://en.wikipedia.org/wiki/Weighted_least_squares#Weighted_least_squares

    Weights are 1/(error)^2, where "error" is the uncertainty in the y-value
     
  4. Jan 29, 2015 #3
    Thanks for the response, but how do you calculate the slope error from that?
     
  5. Jan 29, 2015 #4

    Quantum Defect

    User Avatar
    Homework Helper
    Gold Member

    The wiki entry is not very clear.

    If you can pick up a copy of Bevington, "Data Reduction and Error Analysis in the Physical Sciences" there is a very nice discussion of calculating the errors on the fitting parameters for least-squares with weights. Another source is Press, Teukolsy, Vetterling and Flannery, "Numerical Recipes in C".

    Look at http://mathworld.wolfram.com/LeastSquaresFitting.html for another discussion of this. (Eqs. 34, 35) give equations for the standard errors in the slope and intercept.
     
  6. Jan 29, 2015 #5

    jtbell

    User Avatar

    Staff: Mentor

  7. Jan 29, 2015 #6
    An alternative approach which may be acceptable is to draw lines of 'best fit' that have the maximum and minimum possible value for the slope. Although this is not as rigorous as the method shown in the post above it is an easy alternative (especially if you also have uncertainty in the independent variable). For example, take the first and last data points on the graph and draw the line which just nicks the error bars to form the greatest and least slope. You can show these as dotted lines on the graph as well.
     
  8. Jan 30, 2015 #7
    Thanks everyone this has been a great help!
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Errors of the slope and intercept of a regression line
  1. Interception angle (Replies: 3)

Loading...