Errors of the slope and intercept of a regression line

  • Thread starter h_userd23
  • Start date
3
0

Main Question or Discussion Point

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?
 

Answers and Replies

Quantum Defect
Homework Helper
Gold Member
495
116
3
0
Thanks for the response, but how do you calculate the slope error from that?
 
Quantum Defect
Homework Helper
Gold Member
495
116
Thanks for the response, but how do you calculate the slope error from that?
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.
 
jtbell
Mentor
15,396
3,181
388
130
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.
 
3
0
Thanks everyone this has been a great help!
 

Related Threads for: Errors of the slope and intercept of a regression line

Replies
3
Views
464
  • Last Post
Replies
1
Views
1K
Replies
10
Views
5K
Replies
7
Views
17K
  • Last Post
Replies
2
Views
684
Replies
4
Views
2K
Replies
8
Views
4K
  • Last Post
Replies
3
Views
3K
Top