# Confidence interval of regression line

조회 수: 47(최근 30일)
Lauri Pulkkinen 10 Feb 2021
편집: John D'Errico 10 Feb 2021
Hi!
I am having problems with calculating confidence intervals for my regression line.
More specifically, I calculated first the weighted-least-square regression line from a small data and now would like to calculate a certain confidence interval for this line.
Is it possible to do it with some function that takes only the regression line ŷ = b0 + b1x with known coefficients?

댓글을 달려면 로그인하십시오.

### 채택된 답변

John D'Errico 10 Feb 2021
편집: John D'Errico 10 Feb 2021
If the line has KNOWN coefficients, then a confidence interval is meaningless.
If you want to compute confidence intervals around a line ESTIMATED from sufficient data, then you can use tools from the curve fitting toolbox or the statistics toolbox, and compute confidence intervals trivially.
If you have neither of those tools, there are still sites online that will explain how to compute them. It is not difficult, but you may need to understand statistics well enough to follow what they say. (I'm not sure that is the case, if you are asking how to compute confidence interals around a line with known parameters.)
It is possible that you think your coefficients are known because you have already estimated them. Again, my statement above applies. You do not KNOW the coeffficients. You have only estimated them. The confidence intervals arise based on the uncertainty in your estimates. Essentially you still need to original data, or at least something close to that, such as the matrix decomposition that comes from the estimation.
If you have estimated the parameters, and are stuck on how to do what the sources you have read tell you what to do, then the simplest solution is to do as I have said, just use tools from the curve fitting or stats toolboxes to do it for you. Then you will get a result you can trust.

댓글을 달려면 로그인하십시오.

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by