Tell me more ×
Cross Validated is a question and answer site for statisticians, data analysts, data miners and data visualization experts. It's 100% free, no registration required.

I have a data set of paired measurements $(x_1,y_1),(x_2,y_2),...,(x_n,y_n)$. I need to fit a linear regression line $y=ax+b$ to this data. Therefore, I have to estimate the parameters $a$ and $b$.

How can I then calculate the confidence interval for these estimated parameters?

I referred to the wiki article which says http://en.wikipedia.org/wiki/Simple_linear_regression:

Normal assumption

Under the first assumption above, that of the normality of the error terms, the estimator of the slope coefficient will itself be normally distributed with mean $\beta$ and variance $\sigma^2/\sum(x_i-\bar > x)^2$.

I didn't get how this formula was derived.

share|improve this question
If this is homework, please tag it as such. – JohnRos Jun 30 '12 at 19:05
Your answer is on the wikipedia page about simple linear regression: en.wikipedia.org/wiki/… – Macro Jun 30 '12 at 19:16
I referred to the wiki article. But I didn't get some of the stuff. I have reposted in the question – user34790 Jun 30 '12 at 19:59
1  

2 Answers

How are you fitting the regression equation? Knowing that will help us to help you.

If you are doing the regression by hand, then use the formula in the book that gave you the formula for the regression (or use the wikipedia article in the comments above). Or better yet, get a real statistical software package to help you.

If you are using Excel or another spreadsheet then you should really switch to a real statistics program.

If you are using a statistics program then it may have an option or command that will compute the interval for you (but we don't know what program you are using, so we can't tell you what that command is). Even if the software does not compute the interval for you, it may give you the proper standard errors that you just need to multiply by the proper table value and add and subtract from the coefficient estimate (that formula should be in your textbook or on the wikipedia article).

share|improve this answer

Under normality assumptions for the error term in the model the formulas for the least squares estimates are:
$\beta_0=\bar{y}-\beta_1\bar{x}$ (where $\bar{x}$ is the mean of the $x_i$s and $\bar{y}$ is the mean of the $y_i$s) and $\beta_1=(\sum x_iy_i-n\bar{x}\bar{y})/(\sum x_i^2-n\bar{x}^2)$.

Both $\beta_0$ and $\beta_1$ are then normally distributed and when divided by their estimated standard deviations have t distributions under the null hypothesis that the true value is 0. Given this you can construct confidence intervals based on the t distribution.

share|improve this answer
3  
+1. Michael, given your many expert contributions on this site, it would help users if you would learn and use mathjax so that your answers are easier to read and follow. You can infer a lot about how it works by looking at the edits people have made on your answers. You can also see how any expression on CV was produced by right-clicking on it and then selecting 'Show Math As' -> 'TeX Commands'. I have also found this to be a very comprehensive reference (albeit slow to load). Thanks again. – gung Jul 1 '12 at 15:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.