Undergrad Plot Linear Fit w/ Error Bounds: y=ax+b

Click For Summary
A linear fit of the form y=ax+b has been created for a set of data points, and the user seeks to plot this fit with error bounds reflecting the parameter uncertainties. The discussion highlights the need for upper and lower lines to represent a 1 sigma band around the fit, which may be related to a 95% prediction band indicating confidence in the true line's location. It is suggested that R statistical software can be used to generate these bands, with resources provided for those unfamiliar with R. The conversation also touches on the impact of measurement variability on regression results, emphasizing the importance of confidence intervals derived from hypothesis testing. Understanding the distinction between frequentist and Bayesian approaches is also mentioned as a consideration in the analysis.
kelly0303
Messages
573
Reaction score
33
Hello! I made a linear fit, ##y=ax+b##, to some data points and I get the best parameters with their (1 sigma) errors: ##a\pm\delta a## and ##b\pm\delta b##. I want to plot this fit on top of my data points in such a way as to reflect the error on the parameters. The "main" fit is simply ##y=ax+b## with the parameters obtained from the fit, but I would like 2 more lines as un upper and limit to that (like a 1 sigma band). What formula should I use for the upper and lower lines associated to the boundaries of this band? Thank you! (I would like something like this, although I am not sure why their band is curved)
 
Physics news on Phys.org
I believe that the curved band is a 95% prediction band. This is telling us we are 95% confident that the true line that the data came from, lies in the band. Imagine you can pivot the band a little bit and you'll understand why it is curved.

I believe it can be produced using the R statistical software (available as a free download). Take a look at this from stackexchange - https://stats.stackexchange.com/que...tion-of-confidence-bands-in-linear-regression

If you are unfamiliar with R, then I suggest taking a look at Swirl, a free site that helps you to get it downloaded and has some nice tutorials. https://swirlstats.com/students.html
 
  • Like
Likes FactChecker
Think about you hook up a voltage source to a resistor, and you measure current. From Ohm's Law, we expect a straight line. The slope of the line represents the resistance. But due to factors such as temperature, noise, accuracy of your measuring equipment, you get dots which are not collinear. So you do regression and get the best fit line. The curved band would represent other places that the line might actually lie (with 95% confidence) for this resistor, based on the data measurements.
 
Usually during your regression analysis you do your hypothesis tests which give you confidence intervals for both the intercept and the slope. I believe these are used, at least in/with the frequentist approach. Are you maybe using a Bayesian approach?
 
The standard _A " operator" maps a Null Hypothesis Ho into a decision set { Do not reject:=1 and reject :=0}. In this sense ( HA)_A , makes no sense. Since H0, HA aren't exhaustive, can we find an alternative operator, _A' , so that ( H_A)_A' makes sense? Isn't Pearson Neyman related to this? Hope I'm making sense. Edit: I was motivated by a superficial similarity of the idea with double transposition of matrices M, with ## (M^{T})^{T}=M##, and just wanted to see if it made sense to talk...

Similar threads

Replies
8
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 26 ·
Replies
26
Views
3K
  • · Replies 28 ·
Replies
28
Views
3K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K