## anonymous 5 years ago Could someone tell me how to obtain the least square estimates of the parameters of a regression model? - statistics-

1. anonymous

Are you just looking for linear regression?

2. anonymous

yes.only linear regression. generally in term of Y=a+bx+error.

3. anonymous

You just want the computation formulas, or theory?

4. anonymous

just want to know how to answer if i got a question like this.

5. anonymous

$b=\frac{\sum(x_i-<x>)(y_i-<y>)}{\sum_{}{}(x_i-<x>)^2}=\frac{s_{xy}}{s_{xx}}$That's what b is BUT, I'm going to give you formulas derived from this that you should use when you want to do any kind of computation:

6. anonymous

PS x_i and y_i are data points, <x>, <y> are the means of each.

7. anonymous

$s_{xy}=\sum_{}{}x_iy_i-\frac{\left( \sum_{}{}x_i \right)\left( \sum_{}{}y_i \right)}{n}$

8. anonymous

$s_{xx}=\sum_{}{}x_i^2-\frac{\left( \sum_{}{}x_i \right)^2}{n}$

9. anonymous

Your intercept, a, can be calculated from$<y>-b<x>$ where b is the estimate of the slope you would have found from the above.

10. anonymous

The process of calculating these wipes epsilon.

11. anonymous

You should end up with$Y=\frac{s_{xy}}{s_{xx}}X+(<y>-b<x>)$

12. anonymous

at this point, what should i do with the equation to get the least square estimation?

13. anonymous

Are you talking about epsilon, the error term?

14. anonymous

no. i meant for a and b.

15. anonymous

Your b is $b=\frac{s_{xy}}{s_{xx}}$and your a is$a=<y>-b<x>$You find b first, so you can find a quickly. I didn't put down the sum stuff for a since it would take longer to compute...i.e. you wouldn't use it.

16. anonymous

ok. i understood now.thanks a lot..

17. anonymous

No probs. Become a fan ;)