How can i develop a Regression line with a confidence level bracket around this line?
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Tushar Agarwal
am 29 Sep. 2016
Kommentiert: Star Strider
am 1 Okt. 2016
I have a data set of temperature and energy use.
Temp Energy
I wanted to draw a scatter plot (which i could),and find a confidence level regression line over this scatter plot - any help? I want to see the shaded bracket around the regression line. I have just started with matlab, any help would be golden.
0 Kommentare
Akzeptierte Antwort
Star Strider
am 29 Sep. 2016
I would use the polyfit and polyval functions for the regression, and the File Exchange contribution polypredci for the confidence intervals on the regression.
When you download polypredci, put it in your MATLAB user directory. That will allow you to use it as you would use any other function. On Windows computers, this is:
C:\Users\YourUserName\Documents\MATLAB\
4 Kommentare
Star Strider
am 1 Okt. 2016
That is the accepted way to draw confidence intervals on the regression, because the uncertainty in the prediction increases with increasing distance from the mean of the x and y values. The built-in MATLAB routines in the Statistics and Machine Learning Toolbox and all the other statistics packages do the same. More data will make them straighter. (The ‘delta’ values calculated by polyval do the same, although I’ve never been able to figure out exactly what those are.)
How do you want to calculate the confidence intervals? One way might be to take ±1.96 times the standard error (standard deviation divided by the square root of the number of data points) of the y-data and draw lines parallel to the slope at those distances. This was the standard way to draw them back before computers made the precise computation of the confidence intervals easy.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Descriptive Statistics finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!